alexp11223 / gendiff
hexlet.io project 2
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- docopt/docopt: ^1.0
- funct/funct: ^1.5
- symfony/yaml: ^4.3
Requires (Dev)
- phpunit/phpunit: ^8.3
- squizlabs/php_codesniffer: ^3.4
README
gendiff
Compares two JSON, YAML files and shows the changes between them in different formats: pretty
, plain
, json
.
Installation
- Install PHP 7.2+ and Composer.
- Run
composer global require alexp11223/gendiff
. - Make sure that the Composer global bin dir (
composer global config bin-dir --absolute
) is in yourPATH
.
Usage
gendiff [--format <fmt>] <firstFile> <secondFile>
Examples:
gendiff before.json after.json
gendiff before.yaml after.yaml
gendiff before.json after.yaml
gendiff before.json after.json --format plain
gendiff before.json after.json --format json
pretty
Human-readable JSON-like format similar to diff
.
Flat files:
Nested objects:
plain
Textual description of the changes.
json
JSON tree describing the changes, intended for automated processing.