alexp11223/gendiff

hexlet.io project 2

0.6.0 2019-10-13 14:51 UTC

This package is auto-updated.

Last update: 2024-04-14 01:10:17 UTC


README

Build Status Maintainability 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.
  • Run composer global require alexp11223/gendiff.
  • Make sure that the Composer global bin dir (composer global config bin-dir --absolute) is in your PATH.

asciicast

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:

asciicast

Nested objects:

asciicast

plain

Textual description of the changes.

asciicast

json

JSON tree describing the changes, intended for automated processing.

asciicast