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

@ossl-dev/differens-narrate

v0.2.0

Published

Turns a differens edit script into sentences, markdown, JSON, or a token-frugal format for models

Readme

@ossl-dev/differens-narrate

Turns the edit script from @ossl-dev/differens-core into something a person, or a model, can read.

Part of differens. Template-based and deterministic: no model runs here either.

npm install @ossl-dev/differens-narrate

Sentences

import { narrate, formatChanges, summarize } from "@ossl-dev/differens-narrate";

const changes = narrate(editActions, { filePath: "src/app.ts" });

changes[0].description;
// "renamed function `parseConfig` to `loadConfig`"

summarize(changes);
// "2 additions, 1 modification"

Each entry keeps its original action, so you can render the sentence and still branch on change.action.type.

Narration reads the enclosing scope an action carries, which is where phrases like "removed function retry from class RetryPolicy" come from. Anonymous nodes are introduced by a glimpse of their source rather than as "unnamed", which on a real file was most of the output.

Repeated edits collapse. Renaming a symbol used five times changes five nodes but reports one sentence, keyed on the from/to pair.

Four output formats

formatChanges(changes, { format: "terminal" }); // default, one line per change
formatChanges(changes, { format: "markdown" }); // grouped under file headings
formatChanges(changes, { format: "json" });     // the raw SemanticChange array
formatChanges(changes, { format: "llm" });      // dense, for a model

The llm format

Built to cost less than the diff it replaces. On a 14-file changeset it is 6.5KB where git diff is 100KB.

differens/1 3 files 380 changes 113 named
# apps/cli/src/index.ts
+ function runWorker :373
- function mapWithConcurrency :313
~ function report :141 handleGitDiff -> report
* 12 comments, 3 expressions
# config/app.json
~ leaf port :14 < object database 3000 -> 8080

One line per change, the file named once. + - ~ > are added, removed, changed, moved; * is a rolled-up count. :N is the source line and < Kind name the enclosing scope.

Two things do the work. Changes that carry no name a reader could act on -- comments, prose lines, bare expressions -- collapse into a tally instead of spending a line each. And every named change carries its line number, so a model can read the twenty lines around a change rather than the whole file.

An earlier version of this format was pretty-printed JSON and cost more than the raw diff: keys and the file path repeated per entry, empty fields still emitted, one object per changed line of prose.

Related

MIT. Source.