0.0.6 • Published 5 years ago

frontend-gendiff-lvl2 v0.0.6

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

Description

Gendiff is a command-line difference calculator.
Compares two configuration files and shows a difference.

Installation

sudo npm install -g frontend-gendiff-lvl2

Usage

gendiff [options] <pathToFile1> <pathToFile2>

Options:
-V, --version output the version number
-f, --format [type] Output format
-h, --help output usage information

[type] - plain, json, nested
<pathToFile> - path to json, yaml or ini configuration file

Examples

Flat JSON

before.json:

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

after.json:

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

asciicast

Flat YAML

before.yml:

host: hexlet.io
timeout: 50
proxy: 123.234.53.22
follow: false

after.yml:

timeout: 20
verbose: true
host: hexlet.io

asciicast

Flat ini

before.ini:

host=hexlet.io
timeout=50
proxy=123.234.53.22
follow=false

after.ini:

timeout=20
verbose=true
host=hexlet.io

asciicast

Multi-level configuration files

before.json

{
  "common": {
    "setting1": "Value 1",
    "setting2": "200",
    "setting3": true,
    "setting6": {
      "key": "value"
    }
  },
  "group1": {
    "baz": "bas",
    "foo": "bar",
    "nest": {
      "key": "value"
    }
  },
  "group2": {
    "abc": "12345"
  }
}

after.json

{
  "common": {
    "follow": false,
    "setting1": "Value 1",
    "setting3": {
      "key": "value"
    },
    "setting4": "blah blah",
    "setting5": {
      "key5": "value5"
    },
    "setting6": {
      "key": "value",
      "ops": "vops"
    }
  },

  "group1": {
    "foo": "bar",
    "baz": "bars",
    "nest": "str"
  },

  "group3": {
    "fee": "100500"
  }
}

asciicast

Plain format

asciicast

JSON format

asciicast