@tliu.apps/merge-and-accumulate-json

1.4.0 • Public • Published

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.

npm Package NPM Downloads NPM License


💾 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}

✍️ Authors

LinkedIn

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @tliu.apps/merge-and-accumulate-json

      Weekly Downloads

      0

      Version

      1.4.0

      License

      ISC

      Unpacked Size

      1.72 kB

      Total Files

      3

      Last publish

      Collaborators

      • tliu.apps
      • matthewttc