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

ctxmaster

v0.1.0

Published

Terminal context gauge and visualization layer for tokenmaster: zone-colored budget bar, token velocity, and turns-to-exhaustion for LLM context windows.

Readme

ctxmaster

Visualization layer for tokenmaster, the core context-budget metering and decision engine for LLM applications.

The hero surface is the context gauge: a zone-colored fill bar against the model's effective window with threshold ticks, and ancillary rows for context accounting, capacity provenance, token velocity, projected turns to exhaustion with a conservative bound, zone, reserved output, hidden overhead, and cache prefix. The gauge computes nothing itself; every number comes off tokenmaster's MeterState, and anyone can build an alternative visualizer against the same event stream.

Rendering is raw ANSI with zero runtime dependencies beyond the core: no color library, no terminal framework. Color support is detected from NO_COLOR, FORCE_COLOR, TERM, and TTY state, and can be forced either way.

Install

npm install ctxmaster

Quickstart

import { Meter } from "tokenmaster";
import { ContextGauge } from "ctxmaster";

const meter = Meter.forModel("anthropic:claude-haiku-4-5");
const gauge = new ContextGauge();

gauge.attach(meter); // prints a fresh gauge on every recorded turn

meter.record({ input_tokens: 48_000, output_tokens: 1_200 });

For an in-place updating display in interactive sessions:

const live = gauge.live(meter);
// record turns; the panel updates in place
live.stop();

On Node 24 and later the handle is disposable, so using live = gauge.live(meter) detaches automatically at scope exit. Rendering somewhere other than stdout, or without colors, goes through options: new ContextGauge({ write: sink, colors: false }), and render(state) returns the panel as a string for any environment.

A runnable demonstration lives at examples/demo.mjs in the repository: a simulated agent accelerating from green into critical.

What is in 0.1.0

The terminal gauge with per-turn and live rendering, ported from the Python wrapper with the same panel layout and display formats. Planned next: the advice panel rendering tokenmaster recommendations with their rationale, a CLI, and dashboard surfaces. The crates.io packages of the same names are reserved placeholders until the Rust port lands.

License

MIT