Skip to content

FGRibreau/jsobjectdiff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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"
  }]
}
  • pre/post: javacript code that will wrap the file content in order to yield the object
  • files: an array of files to compare along with their object path

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

  • Laura Felix <laura.felix.loratus[$-at-$]gmail.com>
  • Nicolas Bruel <bruel.nicolas85[$-at-$]gmail.com>
  • Francois-Guillaume Ribreau <npm[$-at-$]fgribreau.com> (http://fgribreau.com/)

About

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

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors