EN | RU
«Difference Calculator» is a CLI utility that determines the difference between two data structures.
Features of the utility:
- Supports different input formats: YAML, JSON.
- Report generation as plain, stylish and JSON.
Make sure you have Node.js version 14 or higher installed.
node --version
Clone the repository locally and install the dependencies.
make install
The project is a tutorial and has not been published. Install the package globally from the local directory. From the project root directory, run the command:
npm link
You may need to use sudo
sudo npm link
gendiff [options] <filepath1> <filepath2>
Use arguments <filepath1>
and <filepath2>
as to the first and second file paths.
The utility works only with .json, .yaml and .yaml extensions.
Use -h
or --help
to display a hint.
gendiff --help
Use -f
or ---format
with the argument <type>
to set the output format
Use plain
, stylish
or json
as <type>
.
If you don't specify a format, the default is stylish
.
gendiff -f plain file1.json file2.json
gendiff file1.yml file2.yaml
or
gendiff -f stylish file1.yml file2.yaml
gendiff -f json file1.json file1.yml