https://github.com/brahmanchik/php-project-48
A package to compare JSON files and show differences
https://github.com/brahmanchik/php-project-48
difference library php8 utility
Last synced: 2 months ago
JSON representation
A package to compare JSON files and show differences
- Host: GitHub
- URL: https://github.com/brahmanchik/php-project-48
- Owner: brahmanchik
- Created: 2025-01-21T20:09:56.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-02-21T15:42:30.000Z (8 months ago)
- Last Synced: 2025-02-21T16:36:57.784Z (8 months ago)
- Topics: difference, library, php8, utility
- Language: PHP
- Homepage:
- Size: 63.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Differ
### Hexlet tests and linter status:
[](https://github.com/brahmanchik/php-project-48/actions)[](https://github.com/brahmanchik/php-project-48/actions/workflows/ci-checks.yml)
[](https://codeclimate.com/github/brahmanchik/php-project-48/maintainability)
[](https://codeclimate.com/github/brahmanchik/php-project-48/test_coverage)
## Description
**Differ** a program that determines the difference between two data structures. The input files can be JSON, YAML or YML.
You can also see the comparison result in various output formats, such as stylish, plain, json.
The default output format is stylish. If the files do not exist, the utility will notify you about it.## Prerequisites
- Linux, MacOS, WSL
- PHP >=8.3
- Composer
- Make
- Git## Libraries
- php-cli-tools
- docopt
- functional-php
- yaml## Install
Downloading the utility and installing dependencies:
```bash
git clone https://github.com/brahmanchik/php-project-48
cd php-project-48
make install
```Give the binary file execution rights:
```bash
sudo chmod +x bin/gendiff
```## Run
To use the utility, run the binary file and specify the output format (stylish by default). Also pass the paths to the two files you need:
```bash
bin/gendiff --format=stylish file1.json file2.json
```You can also choose the second output format plain:
```bash
bin/gendiff --format=plain file1.json file2.json
```
Instead of the flag --format, you can use the short version -f.## Demonstration of comparison with yaml and json files
[](https://asciinema.org/a/HgLB9G9g9BydEq6BaKHbefJIS)