@tliu.apps/merge-and-accumulate-json
v1.4.0
Published
Merge json and Accumulate the value
Downloads
6
Readme
Merge and Accumlate json
When I worked on project, I need to merge 2 jsons and need to add the value which attribute existed in these 2 jsons.
💾 Installation
npm install @tliu.apps/merge-and-accumulate-json
🪧 Usage
const majson = require('@tliu.apps/merge-and-accumulate-json')
💡Sample
const majson = require('@tliu.apps/merge-and-accumulate-json');
var json1 = {
"at": 3,
"on": 5,
"home": 1
};
var json2 = {
"at": 1,
"the": 7,
"in": 4
};
console.log(majson.merge(json1, json2));
// { at: 4, on: 5, home: 1, the: 7, in: 4}