1.1.0 • Published 3 years ago
@timursus/gendiff v1.1.0
Difference calculator
Compares two configuration files and shows a difference.
Supports different data formats: JSON, YAML, INI.
Shows a report in plain text, pretty, or json formats.
Works as CLI utility or as node.js module.
Installation
Make sure, that you have node.js v13+ installed first.
npm install -g @timursus/gendiff
Usage
gendiff [options] <filepath1> <filepath2>
Options:
-h, --help display help for command
-V, --version output the version number
-f, --format <type> output format [pretty, plain, json] (default: "pretty")
Demonstrations of use
Comparison of nested structures. Output to 3 formats.
API
gendiff (filepath1, filepath2 , outputFormat = 'json')
By default, gendiff
returns a diff tree in json string
import gendiff from '@timursus/gendiff';
const diff = gendiff(filepath1, filepath2);