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

job-ledger

v0.2.0

Published

Bookkeeping for scheduled LLM jobs: runs, refs, seen sets and atomic state, so the model only judges

Readme

job-ledger

Bookkeeping for scheduled LLM jobs, so the model only has to judge.

An unattended agent job (a daily digest, a playlist builder) has two kinds of work: judgment, which needs a model, and bookkeeping, which doesn't. Bookkeeping means remembering what's been done, handing items between steps, deduplicating, saving state and laying out the final message. Models are bad at bookkeeping. They mistype ids, renumber items, forget to save, and fight file tools that refuse their writes. Every one of those mistakes has happened in production on Hermes cron jobs.

job-ledger is the bookkeeping half. It's a TypeScript library for MCP servers built around one pattern:

  1. begin: the server collects the items, drops the ones already handled, gives each a short ref (K3), saves a run file, and returns a compact plain-text list.
  2. The model judges: it picks refs, writes short notes, and may hand some refs to subagents. It never copies an id, URL or title between calls.
  3. finish: the server resolves the refs against the run file, applies limits, does the side effects, saves state atomically, and returns the final message for the model to send unchanged.

The model needs no file tools, and state can't be lost by a run that sends its message and stops.

What's in it

| Module | Provides | |---|---| | files | insideDir (no symlinks or escapes), writeAtomic (temp file and rename; keeps the file's mode), withLock (lock file with stale-lock recovery; LockBusyError with an optional message for the model), readJson, updateJson (locked read-modify-write with .bak and corrupt-file recovery) | | runs | RunStore: run files per scope (a-dnb-20261002T150000Z), newest-N pruning, latest() | | refs | assignRefs, cleanRef, resolveRefs: tolerant of k3, [K3], "K3" and repeats | | text | textKey (comparison keys: case, accents, &, punctuation), clip (cut at a clause or word break) | | time | isoSeconds, laterIso (a last-run time that never moves backwards), localDate |

The code comes from medium-reader-mcp and substack-reader-mcp, where it has run the daily digests since 2026-10-02. docs/design.md covers what's planned next: item pools that carry unpicked items forward, pick limits, and size-capped rendering.

Using it

The servers that use it bundle it into their dist/ at build time, so a deploy copies dist/ and nothing else needs installing. During development, depend on the local checkout:

"dependencies": { "job-ledger": "file:../job-ledger" }
import { RunStore, updateJson, resolveRefs } from "job-ledger";

Development

npm install
npm test
npm run build

Node 26 or later. MIT licensed.