Skip to content

A program defining the difference between two data structures

Notifications You must be signed in to change notification settings

conarti/frontend-project-lvl2

Repository files navigation

Actions Status Actions Status Maintainability Test Coverage

Description

Gendiff - a program defining the difference between two data structures.

The capabilities of the utility:

  • Support for different input formats: yaml, json
  • Report generation as plain text, stylish and json

Requirements

  • NodeJS 14+

Installation

Open terminal at destination folder and paste:

git clone https://github.com/conarti/frontend-project-lvl2.git . # clone repository
make install # install dependencies
make test # run tests
make test-coverage # show tests coverage
make lint # run linter

Usage example

# setup cli app
make setup
# stylish
gendiff path/to/file.yml another/path/file.json

{
  + follow: false
    setting1: Value 1
  - setting2: 200
  - setting3: true
  + setting3: {
        key: value
    }
  + setting4: blah blah
  + setting5: {
        key5: value5
    }
}
# plain
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

asciinema

Default output asciicast Plain output asciicast Json output asciicast

Importing

import genDiff from '@hexlet/code';

const diff = genDiff(filepath1, filepath2);
console.log(diff);

About

A program defining the difference between two data structures

Resources

Stars

Watchers

Forks

Packages

No packages published