Skip to content

CLI utility that defines the difference between two data structures

Notifications You must be signed in to change notification settings

zapupenec/genDiff

Repository files navigation

Actions Status CI Maintainability Test Coverage

EN | RU

«Difference Calculator»

«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.

Installation

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

Syntax

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.

Options

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.


Examples

Generating a plain report

gendiff -f plain file1.json file2.json

asciicast

Generating a stylish report

gendiff file1.yml file2.yaml

or

gendiff -f stylish file1.yml file2.yaml

asciicast

Generating a json report

gendiff -f json file1.json file1.yml

asciicast

About

CLI utility that defines the difference between two data structures

Resources

Stars

Watchers

Forks

Packages

No packages published