Небольшая cli-утилита для поиска отличий в конфигурационных файлах (json, yaml, ini).
$ gendiff before.json after.json
{
host: hexlet.io
+ timeout: 20
- timeout: 50
- proxy: 123.234.53.22
+ verbose: true
- follow: false
}
install: sudo npm install -g gendiff-la
.
gendiff before.json after.json
- сравнение двух json-файлов.
gendiff before.yml after.yml
- сравнение двух yaml-файлов.
gendiff before.ini after.ini
- сравнение двух ini-файлов.
--format
- позволяет вывести дифф в плоском формате:
$ gendiff --format plain before.json after.json
Property 'timeout' was updated. From '50' to '20'
Property 'proxy' was removed
Property 'common.setting4' was removed
Property 'common.setting5' was removed
Property 'common.setting2' was added with value: 200
Property 'common.setting6.ops' was added with value: 'vops'
Property 'common.sites' was added with value: 'hexlet.io'
Property 'group1.baz' was updated. From 'bars' to 'bas'
Property 'group3' was removed
Property 'verbose' was added with value: true
Property 'group2' was added with complex value
--json
- позволяет вывести дифф в виде json.