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

@jayoncode/object-diff

v0.3.0

Published

Object Diff — Typed, framework-agnostic deep comparison, change reporting, and patch generation for structured data.

Readme

Object Diff — Typed deep comparison and patch generation for structured data.

npm version license docs

Published as @jayoncode/object-diff on npm.

Stop guessing what changed between two objects. Get path-aware change records, fast dirty checks, RFC 6902-style patches, and review-friendly serialization — built for audit trails, optimistic UI, and sync.

Install

npm install @jayoncode/object-diff
pnpm add @jayoncode/object-diff

The problem it solves

JSON.stringify(a) !== JSON.stringify(b) tells you something changed — not what, where, or how to sync it.

// ❌ brittle equality / no paths / no patch
JSON.stringify(saved) !== JSON.stringify(draft);

@jayoncode/object-diff gives you structured changes you can log, review, and apply.

Quick start — know exactly what changed, then patch it

import { diff, hasChanges, patch, applyPatch, serialize } from "@jayoncode/object-diff";

const saved = {
  profile: { name: "Ada", role: "admin" },
  prefs: { theme: "dark" },
};
const draft = {
  profile: { name: "Ada Lovelace", role: "admin" },
  prefs: { theme: "dark" },
};

if (hasChanges(saved, draft)) {
  const changes = diff(saved, draft);
  await audit.log(serialize(changes, "markdown"));
  const synced = applyPatch(saved, patch(changes));
}

More problem → solution snippets

Dirty-check before an expensive save

import { hasChanges } from "@jayoncode/object-diff";

if (!hasChanges(serverState, localDraft)) {
  return; // nothing to persist
}

await api.save(localDraft);

Build an audit-friendly change list

import { diff, serialize } from "@jayoncode/object-diff";

const changes = diff(before, after);
console.log(serialize(changes, "table"));
// path | type | before | after

Sync clients with patch operations

import { diff, patch, applyPatch } from "@jayoncode/object-diff";

const operations = patch(diff(clientA, clientB));
const merged = applyPatch(clientA, operations);

API

| Function | Description | | ------------------------------------------ | ------------------------------------------------------- | | diff(a, b, options?) | Structured change list with metadata | | compare(a, b, options?) | Deep equality | | hasChanges(a, b, options?) | Fast boolean dirty check | | added, removed, updated, unchanged | Filtered change views | | patch(diff, options?) | Generate patch operations | | applyPatch(target, patch, options?) | Apply patch immutably | | revertPatch(target, patch, options?) | Reverse patch operations | | serialize(diff, format, options?) | Export as json/pretty/markdown/table/html/console/human |

Optional engines (subpaths)

| Import | API | | ---------------------------------- | ----------------------------------------------------------- | | @jayoncode/object-diff/core | Slim diff / compare / hasChanges (no patch/serialize) | | @jayoncode/object-diff/patch | patch / applyPatch / validate / optimize | | @jayoncode/object-diff/merge | merge | | @jayoncode/object-diff/query | find / filter / query | | @jayoncode/object-diff/stats | statistics | | @jayoncode/object-diff/formatter | serialize / createSerializer | | @jayoncode/object-diff/plugins | createEngine | | @jayoncode/object-diff/view | createDiffView (fluent wrapper) |

import { diff } from "@jayoncode/object-diff";
import { createDiffView } from "@jayoncode/object-diff/view";

createDiffView(diff(a, b, { detectMoves: true })).serialize("markdown");

Documentation

Repository

https://github.com/itsjayoncode/joc · Package path: packages/object-diff

License

MIT © JayOnCode