Compares two configuration files and shows a difference.
$ npm i -g cl-diff-tool
$ gendiff [options] <firstConfig> <secondConfig>
-h, --help output usage information
-V, --version output the version number
-f, --format [json|plain] output format
$ 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
}
}