Gendiff is a command-line difference calculator.
Compares two configuration files and shows a difference.
sudo npm install -g frontend-gendiff-lvl2
gendiff [options] <pathToFile1> <pathToFile2>
Options:
-V, --version output the version number
-f, --format [type] Output format
-h, --help output usage information
[type] - plain, json, nested
<pathToFile> - path to json, yaml or ini configuration file
before.json:
{
"host": "hexlet.io",
"timeout": 50,
"proxy": "123.234.53.22",
"follow": false
}
after.json:
{
"timeout": 20,
"verbose": true,
"host": "hexlet.io"
}
before.yml:
host: hexlet.io
timeout: 50
proxy: 123.234.53.22
follow: false
after.yml:
timeout: 20
verbose: true
host: hexlet.io
before.ini:
host=hexlet.io
timeout=50
proxy=123.234.53.22
follow=false
after.ini:
timeout=20
verbose=true
host=hexlet.io
before.json
{
"common": {
"setting1": "Value 1",
"setting2": 200,
"setting3": true,
"setting6": {
"key": "value"
}
},
"group1": {
"baz": "bas",
"foo": "bar",
"nest": {
"key": "value"
}
},
"group2": {
"abc": 12345
}
}
after.json
{
"common": {
"follow": false,
"setting1": "Value 1",
"setting3": {
"key": "value"
},
"setting4": "blah blah",
"setting5": {
"key5": "value5"
},
"setting6": {
"key": "value",
"ops": "vops"
}
},
"group1": {
"foo": "bar",
"baz": "bars",
"nest": "str"
},
"group3": {
"fee": 100500
}
}