Compare and reports the difference of 2 config files in json, yaml or ini formats.
npm install -g project-lvl2-s90
gendiff [options] first_config second_config
-
Default
gendiff first_config second_config
result will be like
{ host: hexlet.io + timeout: 20 - timeout: 50 - proxy: 123.234.53.22 + verbose: true }
-
Plain format
gendiff -f plain first_config second_config
result will be like
Property 'common.setting2' was removed Property 'common.setting6' was removed Property 'common.setting4' was added with value: blah blah Property 'common.setting5' was added with complex value Property 'group1.baz' was updated. From 'bas' to 'bars' Property 'group2' was removed Property 'group3' was added with complex value
-
json format
gendiff -f json first_config second_config
[ { "status": "unchanged", "key": "host", "newValue": null, "oldValue": "hexlet.io", "children": [] }, { "status": "updated", "key": "timeout", "newValue": "20", "oldValue": "50", "children": [] }, { "status": "removed", "key": "proxy", "newValue": null, "oldValue": "123.234.53.22", "children": [] }, { "status": "added", "key": "verbose", "newValue": true, "oldValue": null, "children": [] } ]