Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/denis-ok/hexlet-lvl-2-diff-generator
https://github.com/denis-ok/hexlet-lvl-2-diff-generator
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/denis-ok/hexlet-lvl-2-diff-generator
- Owner: denis-ok
- Created: 2018-01-29T06:19:49.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-13T18:47:49.000Z (over 6 years ago)
- Last Synced: 2024-10-15T02:33:19.650Z (about 1 month ago)
- Language: JavaScript
- Size: 104 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Maintainability](https://api.codeclimate.com/v1/badges/efbe808800ef9ea77cfc/maintainability)](https://codeclimate.com/github/denis-ok/project-lvl2-s185/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/efbe808800ef9ea77cfc/test_coverage)](https://codeclimate.com/github/denis-ok/project-lvl2-s185/test_coverage) [![Build Status](https://travis-ci.org/denis-ok/hexlet-lvl-2-diff-generator.svg?branch=master)](https://travis-ci.org/denis-ok/hexlet-lvl-2-diff-generator)
### Gendiff
**Hexlet JavaScript Project: level 2**
___
This package is a CLI utility for generating diff between two config files.
Input formats: json, yaml, ini
Output formats: json, plainMain purpose of working on this project was practice in Deep-First-Search recursion algorithm and learn principles of how to parse and use abstract syntacs trees. From architectural point of view it is something like adapter and facade patterns.
**Installation:**
```
$ npm install -g strelkov-gendiff
```**Usage:**
```
Usage: gendiff [options]This program take two config files as arguments and show difference
Options:
-V, --version output the version number
-f, --format [type] Output file format (default, JSON, plain)
-h, --help output usage information
```##### Example:
**Config 1:**
```
{
"common": {
"setting1": "Value 1",
"setting2": "200",
"setting3": true,
"setting6": {
"key": "value"
}
},
"group1": {
"baz": "bas",
"foo": "bar"
},
"group2": {
"abc": "12345"
}
}
```**Config 2:**
```
{
"common": {
"setting1": "Value 1",
"setting3": true,
"setting4": "blah blah",
"setting5": {
"key5": "value5"
},
"setting6": {
"key": "value",
"ops": "vops"
}
},"group1": {
"foo": "bar",
"baz": "bars"
},"group3": {
"fee": "100500"
}
}```
**Result Diff (default format):**
```
{
common: {
setting1: Value 1
- setting2: 200
setting3: true
setting6: {
key: value
+ ops: vops
}
+ setting4: blah blah
+ setting5: {
key5: value5
}
}
group1: {
+ baz: bars
- baz: bas
foo: bar
}
- group2: {
abc: 12345
}
+ group3: {
fee: 100500
}
}
```