@anastassin/difference-calculator
v1.6.0
Published
[![Maintainability](https://api.codeclimate.com/v1/badges/31863e92491f55bbfc40/maintainability)](https://codeclimate.com/github/AnastasiyaYS/project-lvl2-s475/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/31863e92491f55bbfc40/te
Downloads
22
Readme
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