1.1.1 • Published 1 year ago

find-json-difference v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

find-json-difference

Calculates the difference between two JSON objects.

const {jsonDiff} = require('find-json-difference');

or

import {jsonDiff} from "find-json-difference"
const json1 = {
    name: 'John Doe',
    age: 30,
    address: {
        street: '123 Main St',
        city: 'New York',
        state: 'NY'
    }
};

const json2 = {
    name: 'John Doe',
    age: 35,
    address: {
        street: '123 Main St',
        city: 'Los Angeles',
        state: 'CA'
    },
    occupation: 'Software Engineer'
};

const differences = jsonDiff(json1, json2);

console.log(differences);
/* output : {
  added: { occupation: 'Software Engineer' },
  deleted: {},
  edited: { age: [ 30, 35 ], address: [ [Object], [Object] ] }
}*/
1.1.1

1 year ago

1.1.0

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago