Skip to content

💻 Utility which calculates and shows a difference between two configuration files

Notifications You must be signed in to change notification settings

kirillmarkeyev/frontend-project-lvl2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tests and linter status:

Actions Status Node.js CI Maintainability Test Coverage

Difference calculator

Difference calculator is a program with command-line interface (CLI) that generates a difference between two data structures or configuration files. Performs the following operations: reading files, parsing incoming data, building a tree of differences, forming the necessary output. The algorithm is based on tree recursion.

Main features:

  • Supports different input formats: json, yaml.
  • Generates a report in the form of plain text, stylish and json.

Installation and usage

Clone the repository:

git clone git@github.com:kirillmarkeyev/frontend-project-lvl2.git

Change the directory:

cd frontend-project-lvl2/

Install the dependecies:

make install

To create a local link and work in your terminal:

sudo npm link

For help run gendiff -h or gendiff --help:

$ gengiff --help
Usage: gendiff [options] <filepath1> <filepath2>

Compares two configuration files and shows a difference.

Options:
  -v, --version        output the version number
  -f, --format <type>  output format (default: "stylish")
  -h, --help           display help for command

Run:

gendiff [options] <path/to/file1> <path/to/file2>

Demonstration

Plain type of input data, json files:

asciicast

Plain type of input data, yaml files:

asciicast

Nested type of input data, output format - stylish:

asciicast

Nested type of input data, output format - plain:

asciicast

Nested type of input data, output format - json:

asciicast