{"adoption": {"forks": 2734, "observed_at": "2026-08-28T04:12:11.706164+00:00", "stars": 50059}, "canonical_url": "https://ross.abutalabs.com/products/pretext", "card": {"archived": false, "artifact_type": "library", "description": "Fast, accurate & comprehensive text measurement & layout", "domain": ["frontend", "web-development", "performance"], "enriched": true, "function": ["templating", "ui-components", "developer-tools"], "health_score": 73, "homepage": "http://chenglou.me/pretext/", "language": "TypeScript", "license": "MIT", "license_family": "permissive", "maturity": "active", "member_repos": ["chenglou/pretext"], "name": "chenglou/pretext", "platform": ["browser"], "pushed_at": "2026-06-23T05:01:09+00:00", "repo": "chenglou/pretext", "stars": 50059, "tags": ["text-measurement", "text-layout", "line-breaking", "knuth-plass", "canvas-measurement", "virtualization", "no-dom-reflow", "multilingual", "nodejs", "web-server", "typescript"], "topics": [], "urls": [], "use_cases": ["measure paragraph height without touching the DOM", "build virtualized lists with accurate text heights", "implement masonry layouts with text cards", "prevent layout shift when text loads", "do Knuth-Plass paragraph justification in the browser", "lay out text lines manually on canvas or SVG", "verify button labels don't overflow during development"], "what_it_is": "Pretext is a pure TypeScript library for fast, accurate multiline text measurement and layout that avoids DOM reflows by using the browser's font engine for measurement and pure arithmetic for layout. It supports rendering to DOM, Canvas, and SVG, handles international text, and offers both height prediction and manual line-level layout APIs.", "when_to_avoid": ["you only need simple CSS text wrapping with no measurement needs", "you need server-side text measurement today (not yet supported)", "your project doesn't use JavaScript in the browser"], "when_to_choose": ["you need text height or line breaks without triggering layout reflow", "you're building virtualization, masonry, or custom layout systems", "you need accurate measurement for multilingual text including CJK and RTL", "you render text to Canvas or SVG and need line-level control"]}, "data_as_of": "2026-08-30T08:39:29.467469+00:00", "members": [{"path": "/products/pretext", "repo": "chenglou/pretext", "role": "main", "score": 55}], "provenance": {"archived": {"kind": "observed", "observed_at": "2026-08-28T04:12:11.706164+00:00", "source": "github"}, "artifact_type": {"confidence": null, "enriched_at": "2026-08-29T16:20:01.864122+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "f78ab8f7b135f0d0a1a40a6707e5069da4efe2de8b7600a837a4e7d4f917e63b", "fetched_at": "2026-08-28T04:12:11.706164+00:00", "kind": "readme", "missing": false, "url": "https://github.com/chenglou/pretext"}, {"content_hash": "585c33c2440f716a42422879491d3e5807dcb9cd0e1728be37971ee1f029555b", "fetched_at": "2026-08-28T18:12:36.713521+00:00", "kind": "homepage", "missing": false, "url": "http://chenglou.me/pretext/"}], "taxonomy_version": 1}, "description": {"kind": "observed", "observed_at": "2026-08-28T04:12:11.706164+00:00", "source": "github"}, "domain": {"confidence": null, "enriched_at": "2026-08-29T16:20:01.864122+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "f78ab8f7b135f0d0a1a40a6707e5069da4efe2de8b7600a837a4e7d4f917e63b", "fetched_at": "2026-08-28T04:12:11.706164+00:00", "kind": "readme", "missing": false, "url": "https://github.com/chenglou/pretext"}, {"content_hash": "585c33c2440f716a42422879491d3e5807dcb9cd0e1728be37971ee1f029555b", "fetched_at": "2026-08-28T18:12:36.713521+00:00", "kind": "homepage", "missing": false, "url": "http://chenglou.me/pretext/"}], "taxonomy_version": 1}, "enriched": {"inputs": [], "kind": "computed", "method": "enrichment_status"}, "function": {"confidence": null, "enriched_at": "2026-08-29T16:20:01.864122+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "f78ab8f7b135f0d0a1a40a6707e5069da4efe2de8b7600a837a4e7d4f917e63b", "fetched_at": "2026-08-28T04:12:11.706164+00:00", "kind": "readme", "missing": false, "url": "https://github.com/chenglou/pretext"}, {"content_hash": "585c33c2440f716a42422879491d3e5807dcb9cd0e1728be37971ee1f029555b", "fetched_at": "2026-08-28T18:12:36.713521+00:00", "kind": "homepage", "missing": false, "url": "http://chenglou.me/pretext/"}], "taxonomy_version": 1}, "health_score": {"inputs": ["days_since_push", "days_since_release", "archived"], "kind": "computed", "method": "health_v1"}, "homepage": {"kind": "observed", "observed_at": "2026-08-28T04:12:11.706164+00:00", "source": "github"}, "language": {"kind": "observed", "observed_at": "2026-08-28T04:12:11.706164+00:00", "source": "github"}, "license": {"kind": "observed", "observed_at": "2026-08-28T04:12:11.706164+00:00", "source": "github"}, "license_family": {"inputs": ["license"], "kind": "computed", "method": "license_family"}, "maturity": {"confidence": null, "enriched_at": "2026-08-29T16:20:01.864122+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "f78ab8f7b135f0d0a1a40a6707e5069da4efe2de8b7600a837a4e7d4f917e63b", "fetched_at": "2026-08-28T04:12:11.706164+00:00", "kind": "readme", "missing": false, "url": "https://github.com/chenglou/pretext"}, {"content_hash": "585c33c2440f716a42422879491d3e5807dcb9cd0e1728be37971ee1f029555b", "fetched_at": "2026-08-28T18:12:36.713521+00:00", "kind": "homepage", "missing": false, "url": "http://chenglou.me/pretext/"}], "taxonomy_version": 1}, "member_repos": {"kind": "observed", "observed_at": "2026-08-28T04:12:11.706164+00:00", "source": "github"}, "name": {"kind": "observed", "observed_at": "2026-08-28T04:12:11.706164+00:00", "source": "github"}, "platform": {"confidence": null, "enriched_at": "2026-08-29T16:20:01.864122+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "f78ab8f7b135f0d0a1a40a6707e5069da4efe2de8b7600a837a4e7d4f917e63b", "fetched_at": "2026-08-28T04:12:11.706164+00:00", "kind": "readme", "missing": false, "url": "https://github.com/chenglou/pretext"}, {"content_hash": "585c33c2440f716a42422879491d3e5807dcb9cd0e1728be37971ee1f029555b", "fetched_at": "2026-08-28T18:12:36.713521+00:00", "kind": "homepage", "missing": false, "url": "http://chenglou.me/pretext/"}], "taxonomy_version": 1}, "pushed_at": {"kind": "observed", "observed_at": "2026-08-28T04:12:11.706164+00:00", "source": "github"}, "repo": {"kind": "observed", "observed_at": "2026-08-28T04:12:11.706164+00:00", "source": "github"}, "stars": {"kind": "observed", "observed_at": "2026-08-28T04:12:11.706164+00:00", "source": "github"}, "tags": {"confidence": null, "enriched_at": "2026-08-29T16:20:01.864122+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "f78ab8f7b135f0d0a1a40a6707e5069da4efe2de8b7600a837a4e7d4f917e63b", "fetched_at": "2026-08-28T04:12:11.706164+00:00", "kind": "readme", "missing": false, "url": "https://github.com/chenglou/pretext"}, {"content_hash": "585c33c2440f716a42422879491d3e5807dcb9cd0e1728be37971ee1f029555b", "fetched_at": "2026-08-28T18:12:36.713521+00:00", "kind": "homepage", "missing": false, "url": "http://chenglou.me/pretext/"}], "taxonomy_version": 1}, "topics": {"kind": "observed", "observed_at": "2026-08-28T04:12:11.706164+00:00", "source": "github"}, "urls": {"kind": "observed", "observed_at": "2026-08-28T04:12:11.706164+00:00", "source": "github"}, "use_cases": {"confidence": null, "enriched_at": "2026-08-29T16:20:01.864122+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "f78ab8f7b135f0d0a1a40a6707e5069da4efe2de8b7600a837a4e7d4f917e63b", "fetched_at": "2026-08-28T04:12:11.706164+00:00", "kind": "readme", "missing": false, "url": "https://github.com/chenglou/pretext"}, {"content_hash": "585c33c2440f716a42422879491d3e5807dcb9cd0e1728be37971ee1f029555b", "fetched_at": "2026-08-28T18:12:36.713521+00:00", "kind": "homepage", "missing": false, "url": "http://chenglou.me/pretext/"}], "taxonomy_version": 1}, "what_it_is": {"confidence": null, "enriched_at": "2026-08-29T16:20:01.864122+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "f78ab8f7b135f0d0a1a40a6707e5069da4efe2de8b7600a837a4e7d4f917e63b", "fetched_at": "2026-08-28T04:12:11.706164+00:00", "kind": "readme", "missing": false, "url": "https://github.com/chenglou/pretext"}, {"content_hash": "585c33c2440f716a42422879491d3e5807dcb9cd0e1728be37971ee1f029555b", "fetched_at": "2026-08-28T18:12:36.713521+00:00", "kind": "homepage", "missing": false, "url": "http://chenglou.me/pretext/"}], "taxonomy_version": 1}, "when_to_avoid": {"confidence": null, "enriched_at": "2026-08-29T16:20:01.864122+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "f78ab8f7b135f0d0a1a40a6707e5069da4efe2de8b7600a837a4e7d4f917e63b", "fetched_at": "2026-08-28T04:12:11.706164+00:00", "kind": "readme", "missing": false, "url": "https://github.com/chenglou/pretext"}, {"content_hash": "585c33c2440f716a42422879491d3e5807dcb9cd0e1728be37971ee1f029555b", "fetched_at": "2026-08-28T18:12:36.713521+00:00", "kind": "homepage", "missing": false, "url": "http://chenglou.me/pretext/"}], "taxonomy_version": 1}, "when_to_choose": {"confidence": null, "enriched_at": "2026-08-29T16:20:01.864122+00:00", "kind": "inferred", "prompt_version": 1, "sources": [{"content_hash": "f78ab8f7b135f0d0a1a40a6707e5069da4efe2de8b7600a837a4e7d4f917e63b", "fetched_at": "2026-08-28T04:12:11.706164+00:00", "kind": "readme", "missing": false, "url": "https://github.com/chenglou/pretext"}, {"content_hash": "585c33c2440f716a42422879491d3e5807dcb9cd0e1728be37971ee1f029555b", "fetched_at": "2026-08-28T18:12:36.713521+00:00", "kind": "homepage", "missing": false, "url": "http://chenglou.me/pretext/"}], "taxonomy_version": 1}}, "score": {"components": {"activity": 89, "longevity": 12, "rhythm": 35}, "computed_at": "2026-09-03T02:20:16.233290+00:00", "flags": ["no_releases", "young"], "formula": "round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)", "inputs": {"age_days": 179, "days_push": 71, "days_rel": null, "gap_med": null, "n_releases_24m": 0}, "score": 55, "version": 2}, "staleness": {"enrichment_outdated": false, "low_confidence": false, "scrape_days": 9, "stale_scrape": false}}