Skip to content

nomadkyr/frontend-project-lvl2

Repository files navigation

Hexlet tests and linter status:

Actions Status

Gendiff

Gendiff programm compares two configuration of files and shows a difference. Function works with .json, .yaml, .yml formats.

Install

  1. Make sure you have installed Node.js no lower version 12: node -v
  2. Clone this repo: https://github.com/nomadkyr/frontend-project-lvl2.git
  3. Get root folder of project, run the commands make install and make link

Usage


  Usage: gendiff [options] <filepath1> <filepath2>

  Compares two configuration files and shows a difference.

  Options:
    -V, --version        output the version number
    -h, --help           output usage information
    -f, --format <type>  output format

Formats

Gendiff can show the difference in three ways: stylish (default), plain and json.

Example of using

gendiff --format plain __fixtures__/file1.json __fixtures__/file2.json

Test

make test make test-coverage

Asciinemas:

  1. Comparing flat files in .json format:

  1. Comparing flat files in .yaml/yml format:

  1. Comparing nested files in .json format:

  1. Showing work of -h option, comparing nested files using --format option:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published