Compares two JSON, YAML files and shows the changes between them in different formats: pretty
, plain
, json
.
- 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
.
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
Human-readable JSON-like format similar to diff
.
Flat files:
Nested objects:
Textual description of the changes.
JSON tree describing the changes, intended for automated processing.