Pretext.js

Pretext.js - DOM 없이 텍스트 측정하는 순수 JS 라이브러리

소개

Pretext.js: DOM 읽기 0회, 순수 JavaScript/TypeScript 텍스트 레이아웃 엔진. Canvas 준비 후 산술로 즉시 높이 계산. 가상 스크롤, 다국어, 고성능 UI에 최적화. 14k+ GitHub 스타.


업데이트된 날짜:

2026년 4월 7일

월간 방문자 수:

SimilarWeb Icon
--

제휴 프로그램:

Yes

Pretext.js's 개요

Pretext.js is a pure JavaScript and TypeScript-first library for fast text measurement and layout without touching the DOM. It eliminates forced synchronous reflows by using Canvas for one-time glyph measurements via prepare(), followed by instant pure arithmetic layouts with layout(). Achieving ~2ms for 1,000 blocks, it supports 12+ writing systems including CJK, Arabic, Hebrew, Thai, Hindi, and Korean. Zero runtime dependencies, real font metrics, reusable handles for multiple widths. Perfect for virtual scrolling, AI chat bubbles, multilingual feeds, and performance-critical text-heavy UIs. 14k+ GitHub stars.


Pretext.js's 특징

  • Zero DOM reads after prepare()

  • Real font metrics via Canvas measureText()

  • Multilingual support for 12+ writing systems

  • TypeScript-first with full types

  • Reusable prepared handles for multiple container widths

  • Zero runtime dependencies

  • Pure arithmetic layout for instant results

  • Accurate line breaking and bidirectional text


Pretext.js's Q&A


Pretext.js's 장단점

장점

  • Blazing fast: 500x faster than DOM reflows, ~2ms for 1000 blocks
  • Accurate real browser font metrics
  • Production-ready multilingual support
  • Zero dependencies, small bundle size
  • Excellent TypeScript integration

단점

  • Requires initial Canvas-based prepare() call
  • Focused on height/lineCount, not full DOM positioning
  • Dependent on browser Canvas API availability
  • Learning curve for prepare/layout workflow
  • Limited to text measurement, not styling or rendering

Pretext.js's 사용 사례

  • Variable-height virtual scrolling for 10,000+ items
  • Pre-computing heights for AI chat bubbles in streaming responses
  • Multilingual content feeds mixing scripts like Chinese, Arabic, Korean
  • Performance-critical text-heavy UIs like code editors or social feeds

Pretext.js's 대상 고객

  • Frontend developers optimizing performance
  • React and framework-agnostic UI builders
  • i18n and multilingual app developers
  • Virtual list and infinite scroll implementers
  • AI chat interface creators

Pretext.js's 가격 책정

Free open-source library published on npm with zero runtime dependencies. No paid tiers or subscriptions mentioned.

Pretext.js's 분석

웹사이트 개요

다음에 대한 주요 성과 지표 pretextjs.dev

이탈률

0.00%

페이지 / 방문

0.00

총 방문 횟수

0

현장 체류 시간

0m 0s

글로벌 순위

#0

국가 순위

#0

인기 지역

국가별 트래픽 분포

No data available.

    총 방문자 수

    지난 3개월간 월별 방문자 통계

    하락 추세 by 0.0% 이번 달
    December - February 2026

    트래픽 소스

    트래픽 소스 분포

    Social:
    0.0%
    Paid Referrals:
    0.0%
    Mail:
    0.0%
    Referrals:
    0.0%
    Search:
    0.0%
    Direct:
    0.0%
    지배적인 소스: Social
    0.0% 총 트래픽의

    Pretext.js's 대안