Difference Calculator is a program that determines the difference between two data structures. This is a popular problem, and there are many online services available to solve it, such as: http://www.jsondiff.com/. A similar mechanism is used when displaying test results or automatically tracking changes in configuration files.
Features of the Utility:
- Support for different input formats: YAML and JSON
- Report generation in plain text, stylish, and JSON formats
- Linux
- PHP 8.3
- Composer
Follow these steps sequentially:
-
Clone the repository:
git clone git@github.com:rnik82/gendiff.git difference-calculator
-
Navigate to the project directory:
cd difference-calculator
-
Install dependencies:
make install
-
Grant execute permissions to the files in the bin directory:
chmod +x ./bin/*
Commands to run the program:
./bin/gendiff -h
— display help../bin/gendiff file1.json file2.json --format stylish
— compare JSON files in stylish format./bin/gendiff file1.yml file2.yml --format stylish
— compare YAML files in stylish format./bin/gendiff file1.json file2.json --format plain
— compare JSON files in plain format./bin/gendiff file1.yml file2.yml --format plain
— compare YAML files in plain format./bin/gendiff file1.json file2.json --format json
— compare JSON files in JSON format./bin/gendiff file1.yml file2.yml --format json
— compare YAML files in JSON format./bin/gendiff file1.json file2.json
— if no format is specified, stylish will be used by default