unstale

npm / tokenx

tokenx

What changed in tokenx 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-28.

4 breaking1 new APIs and options1 performance1 behavior and defaults9 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.9 on npm

tokenx 216 changes

Breaking changes 4

  • CJK text is split at ideographic and fullwidth punctuation, and punctuation is attached to the clause before it.

    2.2.0release notes

  • CJK punctuation is attached to the preceding clause when splitting text.

    2.2.0release notes

  • CJK segments are priced by script rates without trying built-in language configs.

    2.2.0release notes

  • The CLI rejects numeric option values that are too large to represent.

    2.2.0release notes

New APIs and options 1

  • Adds a CLI for counting, slicing and splitting text.

    2.1.0release notes

Performance 1

  • The function stops once the token limit is exceeded.

    2.2.0release notes

Behavior and default changes 1

  • The CLI accepts decimal values for --chars-per-token.

    2.2.0release notes

Fixes and other changes 9

  • A line break is merged into preceding CJK punctuation, as with ASCII punctuation.

    2.2.0release notes

  • Custom language configs are checked before built-in configs instead of replacing them.

    2.2.0release notes

  • Built-in language configs retain the ASCII shortcut when custom configs are set.

    2.2.0release notes

  • Token-slicing boundaries are kept consistent and safe for surrogate pairs.

    2.2.0release notes

  • Overlap no longer repeats a segment that fills a chunk.

    2.2.0release notes

  • The CLI explains directory inputs instead of failing with EISDIR.

    2.1.1release notes

  • The CLI expands glob patterns when the shell does not.

    2.1.1release notes

  • Short option values are split correctly.

    2.1.1release notes

  • Usage output is kept off stdout, so it no longer interferes with command output.

    2.1.1release notes