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.
npm install -g @timursus/gendiff
Requires Node v13+
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
Comparison of nested structures. Color output.
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);