Skip to content

AxeRicin/frontend-project-46

Repository files navigation

Tests and linter status:

Actions Status custom-tests Maintainability Test Coverage

Description:

A difference calculator is a program that determines the difference between two data structures. This is a popular task for which there are many online services, such as JSON DIFF. A similar mechanism is used when outputting tests or when automatically tracking changes in configuration files.

Utility features:

  • Support for different input formats: yaml, json
  • Report generation in the form Plain text, Stylish or JSON

Usage example:

Plain format:

gendiff --format plain path/to/file.yml another/path/file.json

Property 'common.follow' was added with value: false
Property 'group1.baz' was updated. From 'bas' to 'bars'
Property 'group2' was removed

Stylish format:

gendiff filepath1.json filepath2.json

{
  + follow: false
    setting1: Value 1
  - setting2: 200
  - setting3: true
  + setting3: {
        key: value
    }
  + setting4: blah blah
  + setting5: {
        key5: value5
    }
}

Installation:

  • Make sure you have installed Node.js version 12 and above.
  • Clone or download this repository.
  • While in the local directory of the project, use the command make install or make link.
  • gendiff <filepath1> <filepath2> to find differences.

Demonstration of work

Working with gendiff() with a standard formatter and calling a helper:

asciicast

How gendiff() works with Stylish format:

asciicast

How gendiff() works with Plain format:

asciicast

How gendiff() works with JSON format:

asciicast

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published