Gendiff - a program defining the difference between two data structures.
The capabilities of the utility:
- Support for different input formats: yaml, json
- Report generation as plain text, stylish and json
- NodeJS 14+
Open terminal at destination folder and paste:
git clone https://github.com/conarti/frontend-project-lvl2.git . # clone repository
make install # install dependencies
make test # run tests
make test-coverage # show tests coverage
make lint # run linter
# setup cli app
make setup
# stylish
gendiff path/to/file.yml another/path/file.json
{
+ follow: false
setting1: Value 1
- setting2: 200
- setting3: true
+ setting3: {
key: value
}
+ setting4: blah blah
+ setting5: {
key5: value5
}
}
# plain
gendiff --format plain path/to/file.yml another/path/file.json
Property 'common.follow' was added with value: false
Property 'group1.baz' was updated. From 'bas' to 'bars'
Property 'group2' was removed
Default output
Plain output
Json output
import genDiff from '@hexlet/code';
const diff = genDiff(filepath1, filepath2);
console.log(diff);