https://github.com/alexp11223/php-project-lvl2
Compares two JSON, YAML files and shows the changes between them. Project 2 of https://hexlet.io courses.
https://github.com/alexp11223/php-project-lvl2
diff hexlet hexlet-projects json php yaml
Last synced: about 2 months ago
JSON representation
Compares two JSON, YAML files and shows the changes between them. Project 2 of https://hexlet.io courses.
- Host: GitHub
- URL: https://github.com/alexp11223/php-project-lvl2
- Owner: AlexP11223
- Created: 2019-08-07T23:04:37.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-13T14:51:55.000Z (over 6 years ago)
- Last Synced: 2025-02-06T23:31:25.877Z (over 1 year ago)
- Topics: diff, hexlet, hexlet-projects, json, php, yaml
- Language: PHP
- Homepage:
- Size: 49.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/AlexP11223/php-project-lvl2)
[](https://codeclimate.com/github/AlexP11223/php-project-lvl2/maintainability)
[](https://codeclimate.com/github/AlexP11223/php-project-lvl2/test_coverage)
# 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](https://getcomposer.org/doc/00-intro.md#globally).
- Run `composer global require alexp11223/gendiff`.
- Make sure that the Composer global bin dir (`composer global config bin-dir --absolute`) is in your `PATH`.
[](https://asciinema.org/a/9qTbJk0qjlNH8fAXwii5nhB9Z)
## Usage
```
gendiff [--format ]
```
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:
[](https://asciinema.org/a/w1GQYjwBYf8Rw1rCTxosWHG7a)
Nested objects:
[](https://asciinema.org/a/cIOkMEdDKqhijQ6f0WuoAWNS0)
### plain
Textual description of the changes.
[](https://asciinema.org/a/jG4WCuuqGt4TEBaFOikZWb5e9)
### json
JSON tree describing the changes, intended for automated processing.
[](https://asciinema.org/a/WsoXeiMW6AGnaS7cgNfVua4ZG)