Project 'Difference calculator'. The project implements a utility to find differences in configuration files.
Utility Features:
- support for different formats - json, yaml, ini;
- generating a report in the form of plain text, pretty and json
npm i -g project-gendiff
$ gendiff --help
Usage: gendiff [options] <firstConfig> <secondConfig>
Compares two configuration files and shows a difference.
Options:
-V, --version output the version number
-f, --format [type] Output format (default: "stylish")
-h, --help output usage information
file1:
{
"host": "hexlet.io",
"timeout": 50,
"proxy": "123.234.53.22",
"follow": false
}
file2:
{
"timeout": 20,
"verbose": true,
"host": "hexlet.io"
}
run:
gendiff 'file1.json' 'file2.json'
run:
gendiff 'file1.yml' 'file2.yml'
This is an application implemented as part of the second project when studying the profession of a Javascript developer on hexlet.io . The second project is a logical development of the first It captures most of the syntactic capabilities of js and uses a more complex architecture. Requirements:
- learn how to create full-fledged CLI applications (command-line interface), with parsing of input parameters, validation, and help generation;
- understand json, yaml, ini data formats - understand the structure, learn how to parse in js and back;
- work with trees - traversal, transformation, formation of AST (abstract syntactic tree) - a bit of code boiling the brain;
- get to know and put into practice the architectural principles of 'Facade', 'Adapter';
- implement subtype polymorphism in practice;
- make the whole project in a functional style.