2.1.0 • Published 6 years ago

gendiff-blazecolour-2 v2.1.0

Weekly downloads
7
License
MIT
Repository
github
Last release
6 years ago

gendiff-cli

Maintainability Coverage Status Build Status

NPM

A tool for files differences by parsing them into AST, sorting them, and comparing the stringified output. Useful for finding changes in configuration files.

Install

CLI:

npm install -g gendiff-blazecolour-2

library:

npm install --save gendiff-blazecolour-2

Usage

CLI usage:

$ gendiff [options] <file1> <file2>

API usage:

import genDiff from 'gendiff-blazecolour-2';

genDiff('path/to/file1', 'path/to/file2', format);

CLI options

-v, --version        Output the version number
-f, --format [type]  Output format: tree, plain, json (default: tree)
-h, --help           Output usage information

Available format files

The following extensions are available for input files:

  • json
  • yml
  • ini

The output formats:

  • tree
  • plain
  • json

Examples

Comparing two json files.

Output

file1:

{
  "host": "hexlet.io",
  "timeout": 50,
  "proxy": "123.234.53.22",
  "follow": false
}

file2:

{
  "timeout": 20,
  "verbose": true,
  "host": "hexlet.io"
}

input

tree format:

{
    host: hexlet.io
  + timeout: 20
  - timeout: 50
  - proxy: 123.234.53.22
  + verbose: true
  - follow: false
}

plain format:

Property 'timeout' was changed. From '50' to '20'
Property 'proxy' was deleted
Property 'follow' was deleted
Property 'verbose' was added with value: 'true'

Asciinema

asciicast

License

MIT

2.1.0

6 years ago

2.0.7

6 years ago

2.0.6

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago