1.6.0 • Published 6 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-calculatorUsage
CLI application
Usage: gendiff [options] <firstConfig> <secondConfig>
Options:
-V, --version output the version number
-f, --format [type] Output format
-h, --help output usage informationLibrary
import genDiff from 'genDiff';
const diff = genDiff(pathToFile1, pathToFile2);
console.log(diff);Run
Compare flat JSON files
$ gendiff firstPath.json secondPath.jsonCompare flat YAML files
$ gendiff firstPath.yml secondPath.ymlCompare flat INI files
$ gendiff firstPath.ini secondPath.iniCompare tree files (JSON, YAML, INI)
$ gendiff firstPath.json secondPath.jsonor
$ 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.iniDisplay comparison in plain format
$ gendiff -f plain firstPath.json secondPath.iniChoose JSON output format
$ gendiff -f json firstPath.ini secondPath.yml