Skip to content

SplitCode/Difference-Generator

Repository files navigation

Difference Generator

Hexlet tests and linter status:

Actions Status

Code Climate status:

Maintainability Test Coverage

Integration status

.github/workflows/main.yml

Description

Difference Generator - is a program that identifies the difference between two data structures. The program can be used as a command-line utility or installed as a library in third-party applications.

Features:

  • Input formats: YAML, YML, JSON.
  • Formats to display:
  1. STYLISH (default) - output of differences in text format;
  2. PLAIN - output of differences in the form of a tree structure;
  3. JSON - output differences in JSON format. This format allows you to use the output in machine reading.

To get help information about utility use default help option -h, --help

gendiff -h

System requirements:

Node.js >= v16.9.0

Setup

make install
npm link

Demonstration

Comparison of flat JSON format files

gendiff __fixtures__/file1.json __fixtures__/file2.json

asciicast

Comparison of flat YML/YAML format files

gendiff __fixtures__/file1.yml __fixtures__/file2.yaml

asciicast

Comparison of JSON/YML/YAML format files with nested structure in 'stylish' format

gendiff --format stylish __fixtures__/file3.json __fixtures__/file4.json

asciicast

Comparison of JSON/YML/YAML format files with nested structure in 'plain' format

gendiff --format plain __fixtures__/file3.json __fixtures__/file4.yaml

asciicast

Comparison of JSON/YML/YAML format files with nested structure in 'json' format

gendiff --format json __fixtures__/file3.json __fixtures__/file4.yaml

asciicast

About

2-nd HEXLET PROJECT. CLI utility that identifies the difference between two data structures.

Resources

Stars

Watchers

Forks

Packages

No packages published