Licence
ISC
Version
1.1.0
Deps
5
Size
9 kB
Vulns
0
Weekly
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.
Getting started
npm install -g @timursus/gendiff
Requires Node v13+
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")
--color enable color highlighting for "pretty" or "plain" output
Demonstrations of use
Comparison of nested structures. Color output.
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);