Home

Awesome

jsobjectdiff Build Status Deps Version

Ensure that two JavaScript files containing objects have the same keys and display differences.

We use it at @Bringr for diffing i18n files.

Setup

npm install jsobjectdiff -g
<p align="center"> <img src="https://cloud.githubusercontent.com/assets/138050/7396618/d95fbfe4-eea2-11e4-95a5-10e728402354.gif" /> </p>

Usage

$ jsobjectdiff

config argument is required

Usage: node jsobjectdiff [options]

Options:
   -c, --config   JSON configuration path

Where the configuration file must be something like:

{
  "pre": "(function (Bringr) {",
  "post": "return Bringr;})({});",
  "files": [{
    "filePath": "./fixtures/en_US.js",
    "objectPath": "i18n.en_US"
  }, {
    "filePath": "./fixtures/fr_FR.js",
    "objectPath": "i18n.fr_FR"
  }]
}

Output sample

  The file ./fixtures/en_US.js have 1 key(s) added line(s) : 6
  Keys : SEARCH_TEMPLATE_INTRO
  The file ./fixtures/fr_FR.js have 1 key(s) added line(s) : 6
  Keys : SEARCH_SOURCES_RESERVED_INTRO

Contributors