backend-project-lvl2-ifoxman

3.0.0 • Public • Published

backend-project-lvl2

Node CI Maintainability Test Coverage

Compares two configuration files and shows a difference

Installation

from github

git clone https://github.com/iFoxMan/backend-project-lvl2

cd backend-project-lvl2

make install

make build

npm link .

asciicast

from npm

npm install -g backend-project-lvl2-ifoxman

asciicast

Input data

gendiff support json, yml and ini files. For example these file pairs.

// 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
  }
}
// before.yml
---
common:
  setting1: 'Value 1'
  setting2: 200
  setting3: true
  setting6:
    key: 'value'

group1:
  baz: 'bas'
  foo: 'bar'
  nest:
    key: 'value'

group2:
  abc: 12345

// after.yml
---
  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
// before.ini
[common]
setting1 = "Value 1"
setting2 = '200'
setting3 = 'true'
[common.setting6]
key = "value"

[group1]
baz = "bas"
foo = "bar"
[group1.nest]
key = "value"

[group2]
abc = '12345'

// after.ini
[common]
follow = 'false'
setting1 = "Value 1"
setting4 = "blah blah"
[common.setting3]
key = "value"
[common.setting5]
key5 = "value5"
[common.setting6]
key = "value"
ops = "vops"

[group1]
foo = "bar"
baz = "bars"
nest = "str"

[group3]
fee = '100500'

Output data

gendiff support stylish, plain and json format. For example these.

stylish

gendiff before.json after.json

or

gendiff --format stylish before.json after.json

asciicast

plain

gendiff --format plain before.yml after.yml

asciicast

json

gendiff --format json before.ini after.ini

asciicast

Dependencies (4)

Dev Dependencies (13)

Package Sidebar

Install

npm i backend-project-lvl2-ifoxman

Weekly Downloads

7

Version

3.0.0

License

ISC

Unpacked Size

36.7 kB

Total Files

9

Last publish

Collaborators

  • ifoxman