An object difference library for NodeJS.
npm install objecdiffThis module can compares two objects and return the key that has changed along with the original and updated values.






``bash`
$ npm install objecdiff
`javascript
const objecdiff = require('objecdiff');
// Alternatively:
import { diff } from 'objecdiff';
`
#### diff(original, updated) Documentation
`javascript
objecdiff.diff(objectA, objectB)
// Alternatively if using the import method shown above:`
diff(objectA, objectB)
* objectA - Object - The original or first object that you would like to compare.objectB
* - Object - The updated or second object that you would like to compare the first against.
#### Example
`javascript
import { diff } from 'objecdiff';
let a = {
firstName: 'Mike',
lastName: 'R',
city: 'Boston'
},
b = {
firstName: 'Dan',
name: 'Dan G',
color: {
favorite: 'blue'
},
city: 'Boston'
};
console.log(diff(a, b));
// => [ { path: 'firstName', original: 'Mike', updated: 'Dan' },
// => { path: 'lastName', original: 'R', updated: undefined },
// => { path: 'name', original: undefined, updated: 'Dan G' },
// => { path: 'color.favorite', original: null, updated: 'blue' } ]
`
`bash`
$ npm test
To see test coverage, please run:
`bash``
$ npm run coverage