A MongoDB-compatible JSON diff library that computes differences between two JSON objects and produces delta objects using MongoDB operators like $set, $unset, $rename, and $inc. Version 1.1.0 currently stable; low release cadence (last update 2015). Key differentiators: output directly usable with MongoDB collection.update(), supports incremental diffs via $inc option, and provides apply() to apply diffs without manual traversal. Suitable for syncing JSON documents or generating MongoDB update commands.
npm install rus-diffNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows diffing two objects and applying the delta with clone to avoid mutation.
Use apply(clone(a), delta) to avoid mutation.
Manually compute numeric differences or use diff with { inc: true } but be aware it is not recommended for production.For arrays, consider manual comparison or a specialized diff library.
Use named imports like import { diff } from 'rus-diff' instead of default import.Use named import: import { diff } from 'rus-diff'Remove the require('babel/polyfill') line and use native ES6 features or add @babel/polyfill as a separate dependency.Call diff(a, b, [], { inc: true }) to enable $inc.Apply $rename separately or use apply() which handles it correctly.
No dependency data recorded yet.