cl-diff-tool

command line diff tool


Keywords
js, node, nodejs, hexlet, cl, difftool
License
ISC
Install
npm install cl-diff-tool@0.1.4

Documentation

cl-diff-tool

Compares two configuration files and shows a difference.

Build Status

Usige

$ npm i -g cl-diff-tool
$ gendiff [options] <firstConfig> <secondConfig>

Options

-h, --help           output usage information
-V, --version        output the version number
-f, --format [json|plain]  output format

Example

$ cat data1.json

{
	"name":"John",
	"age":30,
	"cars":[ "Ford", "BMW", "Fiat" ]
}
$ cat data2.json

{
	"name":"John",
	"age":50,
	"cars": ["Tesla"],
	"children": {
		"name": "Den",
		"age": 20,
		"cars": "BMW"
	}
}
$ gendiff data1.json data2.json
{
    name: John
  + age: 50
  - age: 30
    cars: {
      + 0: Tesla
      - 0: Ford
      - 1: BMW
      - 2: Fiat
    }
  + children: {
        name: Den
        age: 20
        cars: BMW
    }
}