A CLI tool for comparing files (JSON/YAML) and displaying differences in multiple formats.
- Supports JSON and YAML input formats
- Three output formats:
- Stylish (default) - colored tree-like output
- Plain - clean textual description
- JSON - machine-readable format
# Clone repository
git clone https://github.com/ElenaManukyan/Difference-Calculator.git
cd Difference-Calculator
# Install dependencies
npm install
# Install globally (optional)
npm install -g .# Run linter
npx eslint .
make lint
# Run tests
npm test
make test
# Run formatter
npx prettier --write .gendiff -h
Usage: gendiff [options] <filepath1> <filepath2>
Compares two configuration files and shows a difference.
Options:
-V, --version output the version number
-f, --format <format> output format (default: "stylish")
-h, --help display help for command
# JSON files
gendiff file1.json file2.json
# YAML files
gendiff file1.yml file2.yml
# With plain format
gendiff --format plain nested1.json nested2.json
# Get JSON output
gendiff --format json nested1.yml nested2.yml