TheKr1d / Gendiff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hexlet tests and linter status:

Actions Status Maintainability test 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.
  1. Tilt the repository:
  git clone git@github.com:TheKr1d/frontend-project-lvl2.git
  1. Establish a dependency:
  make install
  make publish

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>

Work example.

Running the compare 2 json files command.

asciicast

Perform a comparison of 2 json files with the format plain.

asciicast

About


Languages

Language:JavaScript 97.5%Language:Makefile 2.5%