npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vigesimal

v1.0.0

Published

Token-efficient serialization for LLM context — beats TOON and JSON on accuracy and tokens (benchmark-validated on two Claude models)

Readme

vigesimal

Token-efficient serialization for LLM context. Flat, repeated records — query results, agent state, tool output — encoded in a compact block the model reads at least as accurately as JSON, at a fraction of the tokens.

[
  { "id": 1, "department": "Engineering", "role": "Senior", "active": true },
  { "id": 2, "department": "Engineering", "role": "Junior", "active": false }
]

becomes

## employees: 2 rows
fields: id,department,role,active
codes: D1=Engineering
bool: 1=yes 0=no  null: _

1,D1,Senior,1
2,D1,Junior,0

Field names declared once; repeated values earn short dictionary codes only when a token-payoff rule proves they save more than they cost; booleans and nulls collapse to single glyphs. Lossless — proper CSV quoting and code-collision handling, unlike bare CSV.

Benchmark-validated on two Claude models: beats TOON-style CSV on accuracy and tokens (63.7% vs 63.1% at fewer tokens on claude-haiku-4-5; 59.2% vs 57.0% on claude-sonnet-5), and uses ~62% fewer tokens than pretty JSON while scoring ~9 points higher. Full methodology and raw per-question results: BENCHMARK.md.

Install

npm install vigesimal

Usage

import { encode, decode, inferSchema } from 'vigesimal'

const block = encode(users, { name: 'users' })   // schema inferred
const rows  = decode(block)                      // numeric columns coerced

// Exact round-trip (booleans included): keep the schema
const schema = inferSchema('users', users)
const exact  = decode(encode(users, { name: 'users', schema }), schema)

Session deltas for agent state

Send full state once, then only what changed each turn:

import { SchemaRegistry, AdaptiveCompressor } from 'vigesimal'

const registry = new SchemaRegistry()
registry.infer('agentState', [initialState])
const session = new AdaptiveCompressor(registry).createSession('agentState')

session.compress({ tier: 'free', step: '1/5', status: 'ok' })  // full block
session.compress({ tier: 'free', step: '2/5', status: 'ok' })  // "~step=2/5"

A drift-aware tracker re-sends the full state automatically when deltas stop paying off.

Exact token accounting

The dictionary payoff rule defaults to a chars/4 estimate; plug in a real tokenizer for exact decisions:

import { getEncoding } from 'js-tiktoken'
const enc = getEncoding('o200k_base')
encode(users, { name: 'users', est: (s) => enc.encode(s).length })

When not to use it

Deeply nested or heterogeneous JSON (the format targets flat, repeated records), payloads under ~3 rows (header overhead dominates), and aggregation-heavy prompts (models are bad at arithmetic over any serialization — do the math in code).

Docs

License

MIT