Diffcore logo

open-source product · Rust + WASM on npm

Diffcorefast Rust/WASM JSON diff engine

tldr

Diffcore is a JSON diff engine written in Rust and compiled to WebAssembly, shipped to npm so JavaScript and TypeScript projects get native-speed diffing with no native addon. It returns real JSON Pointer paths (RFC 6901) and decoded values, emits standard RFC 6902 JSON Patch, and ships applyPatch / revertPatch for state sync, undo/redo, and optimistic UI, plus a React useDiff hook, a CLI, and a streaming engine for multi-GB files.

install

npm install diffcore

import { diff, applyPatch } from "diffcore";
const patch = diff(a, b);   // RFC 6902 JSON Patch
const next = applyPatch(a, patch);

why it's fast

The engine is Rust compiled with wasm-bindgen, so there is no native addon to build and no separate .wasm file to host. In head-to-head benchmarks it runs 2.3-3.0× faster than fast-json-patch and 4-8× faster than jsondiffpatch, sustaining 390-650 MB/s.

npm

Live npm stats: refreshed a few times a day.

864 total downloads

  • diffcore
    Rust/WASM JSON diff · RFC 6902 · React + CLI
    v1.3.0 · since Jan 31, 2026
    864downloads

Built by Dibbayajyoti Roy. Questions or want to use it? Get in touch.