1.6.0 • Published 5 years ago
@anastassin/difference-calculator v1.6.0
project-lvl2-s475
Compares two configuration files and shows a difference.
Setup
$ sudo npm install -g @anastassin/difference-calculator
Usage
CLI application
Usage: gendiff [options] <firstConfig> <secondConfig>
Options:
-V, --version output the version number
-f, --format [type] Output format
-h, --help output usage information
Library
import genDiff from 'genDiff';
const diff = genDiff(pathToFile1, pathToFile2);
console.log(diff);
Run
Compare flat JSON files
$ gendiff firstPath.json secondPath.json
Compare flat YAML files
$ gendiff firstPath.yml secondPath.yml
Compare flat INI files
$ gendiff firstPath.ini secondPath.ini
Compare tree files (JSON, YAML, INI)
$ gendiff firstPath.json secondPath.json
or
$ gendiff firstPath.yml secondPath.ini
Сhoose one of unstructured output formats: tree (by default) or plain
Display comparison in tree format (by default)
$ gendiff firstPath.yml secondPath.ini
Display comparison in plain format
$ gendiff -f plain firstPath.json secondPath.ini
Choose JSON output format
$ gendiff -f json firstPath.ini secondPath.yml