@timursus/gendiff

1.1.0 • Public • Published

Difference calculator

Workflow Maintainability Test Coverage

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. asciicast_gendiff

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);

Package Sidebar

Install

npm i @timursus/gendiff

Weekly Downloads

1

Version

1.1.0

License

ISC

Unpacked Size

8.83 kB

Total Files

9

Last publish

Collaborators

  • timursus