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

jdelta

v0.1.0

Published

Structural diff for two JSON files — see which values changed, by path, ignoring key order and whitespace. Zero dependencies.

Downloads

122

Readme

jdelta

A structural diff for two JSON files. git diff and diff work on lines — so reformatting, reordered keys, or a changed indent drown the one value you actually care about in red-and-green noise. jdelta compares the data, not the text, and tells you exactly which values changed, addressed by path. Zero dependencies, no network.

$ npx jdelta before.json after.json

Added (2)
  + email         "[email protected]"
  + user.tags[2]  "d"

Removed (1)
  - legacyId      1001

Changed (3)
  ~ user.age      30 → 31
  ~ user.role     "viewer" → "admin"
  ~ user.tags[1]  "b" → "c"

+2  -1  ~3

Why

You're reviewing a config change, an API-response snapshot, a tsconfig, a locale file — and the diff is unreadable because someone ran a formatter or the serializer reordered keys. You don't care that line 40 moved to line 12; you care that auth.required flipped to false. jdelta ignores key order and whitespace entirely and reports the actual value-level delta by path.

Usage

jdelta old.json new.json            # human-readable, grouped by added/removed/changed
jdelta old.json new.json --json     # machine-readable
jdelta old.json new.json --quiet    # just the +a -r ~c summary line
jdelta old.json new.json --exit-code  # exit 1 if they differ (CI gate)

Options

| Flag | Effect | |------|--------| | --json | Emit { added, removed, changed, summary } as JSON | | --quiet | Print only a one-line summary (+a -r ~c, or no differences) | | --exit-code | Exit 1 when the files differ (for CI gates) | | -v, --version | Print version | | -h, --help | Show help |

How it reads the diff

  • Paths. Object keys use dot notation (user.profile.age); array elements use index notation (items[2].price). Keys that aren't plain identifiers — containing dots, spaces or hyphens, or starting with a digit — fall back to quoted brackets: ["order-id"], ["123"].
  • Added / Removed / Changed. A key present on only one side is added or removed; a key on both with a different value is changed. A type change (numberstring, objectarray) is reported as a single changed entry tagged with the kinds — not as an add + remove.
  • Arrays are compared by index. xs[2] is compared to xs[2]; a length change shows up as added/removed trailing elements. (Inserting at the front of an array therefore reads as "everything shifted" — index diffing is simple and predictable rather than guessing at moves.)
  • Numbers are compared by value (1 and 1.0 are equal). Two caveats follow from how each runtime parses JSON numbers:
    • Float display. Floats are rendered by each runtime's native serializer, so an integral float can show as 1 (Node) or 1.0 (Python), and exotic floats (e.g. 1e-7) may differ in formatting. The detected change is the same.
    • Large integers. JavaScript has no bigint in JSON, so the Node build parses every number as an IEEE-754 double: integers beyond ±2^53 (snowflake IDs, int64 database keys) lose precision and can compare equal when they aren't — so the Node build may miss a change to such a value (and --exit-code won't fire). The Python build keeps integer precision exactly — prefer it for large-integer data.
  • Long values are abbreviated in the human view (truncated with past ~72 characters). --json output is never truncated.

--json shape

{
  "added":   [{ "path": "email", "value": "[email protected]" }],
  "removed": [{ "path": "legacyId", "value": 1001 }],
  "changed": [{ "path": "user.age", "from": 30, "to": 31 }],
  "summary": { "added": 1, "removed": 1, "changed": 1, "total": 3 }
}

Exit codes

| Code | Meaning | |------|---------| | 0 | success (default — even when the files differ) | | 1 | files differ and --exit-code was passed | | 2 | error (bad args, unreadable file, invalid JSON) |

By default jdelta is a viewer and exits 0; add --exit-code to make it a gate (the git diff --exit-code convention).

License

MIT