Skip to content

Difference Finder is a program that determines the difference between two data structures. This is a common task for which there are numerous online services, for example, http://www.jsondiff.com/. This mechanism is used when outputting tests or tracking changes in configuration files.

Rema04Dev/difference-finder-cli

Repository files navigation

Hexlet tests and linter status:

Actions Status

jest-test

Linter Status

Maintainability

Test Coverage

Description

This is utility that determines the difference between two data structures. A similiar mechanism is used when outputting tests or when automatically tracking changes in configuration files.

Utility features:

  • Support for different input formats: yaml, json, ini
  • Generation a report in the form of plain text, stylish, 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
    }
}

Install

system requirements:

Node 14.x version at least

#clone this repository on your machine
$git clone git@github.com:Rema04Dev/cli-gendiff.git

#go to directory where you downloaded it
$cd cli-gendiff

# run the one of these command to install all necessary dependencies
$make install
or
$npm ci

# this command is responsible for linking commands from package.json to "./bin" directory
$npm link

#run utility
$ gendiff <filepath1> <filepath2>

Usage Demonstration

Different outcoming types

About

Difference Finder is a program that determines the difference between two data structures. This is a common task for which there are numerous online services, for example, http://www.jsondiff.com/. This mechanism is used when outputting tests or tracking changes in configuration files.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published