0.6.7 • Published 7 years ago

aethra-gendiff v0.6.7

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

Difference Generator

Hexlet project

Maintainability Test Coverage

Build Status

npm


Description

Compares two configuration files and shows the difference. Supported formats: json, yaml, ini.


Installation

$ npm install aethra-gendiff

Usage

$ gendiff --help

  Usage: gendiff [options] <firstConfig> <secondConfig>

  Compares two configuration files and shows the difference.
  Supported formats: json, yaml, ini.

  Options:

    -V, --version        output the version number
    -f, --format [type]  output format - default: raw. Supported: plain, raw, json.
    -h, --help           output usage information

Example

before.json

{
  "key1": "was not changed",
  "key2": "to be removed",
  "key3": "was not changed",
  "nested": {
    "innerKey1": "to be removed"
  }
}
after.json

{
  "key1": "was changed",
  "key3": "was not changed",
  "key4": "was added",
  "nested": {
    "innerKey2": "was added"
  }
}
$ gendiff before.json after.json

{
  + key1: was changed
  - key1: was not changed
  - key2: to be removed
    key3: was not changed
    nested: {
      - innerKey1: to be removed
      + innerKey2: was added
    }
  + key4: was added
}
$ gendiff -f plain before.json after.json

Property 'key1' was updated. From 'was not changed' to 'was changed'
Property 'key2' was removed
Property 'nested.innerKey1' was removed
Property 'nested.innerKey2' was added with value: 'was added'
Property 'key4' was added with value: 'was added'
$ gendiff -f json before.json after.json

[{"key":"key1","type":"changed","valueBefore":"was not changed","valueAfter":"was changed"},{"key":"key2","type":"removed","value":"to be removed"},{"key":"key3","type":"common","value":"was not changed"},{"key":"nested","type":"nested","children":[{"key":"innerKey1","type":"removed","value":"to be removed"},{"key":"innerKey2","type":"added","value":"was added"}]},{"key":"key4","type":"added","value":"was added"}]
0.6.7

7 years ago

0.6.6

7 years ago

0.6.5

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.1

7 years ago