Difference Calculator is a command-line utility that helps you compare and identify the differences between two data structures. Whether you're working with YAML, JSON, or INI files, this tool allows you to easily analyze and understand the variations between them.
- Support for multiple input formats: YAML, JSON, INI
- Three output formats to choose from: plain text, stylish, and JSON
- Intuitive and user-friendly command-line interface
- Fast and efficient comparison algorithm
# format plain
gendiff --format plain path/to/file.yml another/path/file.json
Property 'common.follow' was added with value: false
Property 'group1.baz' was updated. From 'bas' to 'bars'
Property 'group2' was removed
# format stylish
gendiff path/to/file.yml another/path/file.json
{
+ follow: false
setting1: Value 1
- setting2: 200
- setting3: true
+ setting3: {
key: value
}
+ setting4: blah blah
+ setting5: {
key5: value5
}
}
# format json
gendiff --format json path/to/file.yml another/path/file.json
[{"key":"common","type":"nested","children":[{"key":"follow","value":false,"type":"added","meta":{}}]
Node 16.x version at least
# Clone this repository
git clone [email protected]:Sergey-frontend/difference-calculator.git
# Go to dowloaded directory
cd difference-calculator
# Install dependencies
npm ci
# Link package.json to "./bin" directory
npm link
# Use utility
gendiff <filepath1> <filepath2>
# Or get more info
gendiff --help