2diff
v3.1.2
Published
Node.js object difference
Downloads
12
Readme
Node.js object difference
2diff
Instalation
npm i -S 2diff
Usage
const diff = require('2diff');
const before = {c: 3, a: 1, b: '2', e: {x: 9}};
const after = {a: 1, b: 1, e: {x: 9}, f: {x: 9}};
const result = diff(before, after);
console.log(result);
Output:
[
{ removed: true, key: 'c', value: 3 },
{ removed: true, key: 'b', value: '2' },
{ added: true, key: 'b', value: 1 },
{ added: true, key: 'f.x', value: 9 }
]