Difference Calculator is a CLI utility for comparing two data structures. It identifies and displays the differences between them in various formats. This tool is widely used in real-world scenarios, such as tracking configuration changes or analyzing test results.
- Supports JSON and YAML input formats.
- Generates output in three formats:
- Stylish (tree-like structure)
- Plain text (detailed textual description)
- JSON (structured data for further processing)
Node.js >= 14
- Make sure you have Node.js version 14 or higher installed.
- Clone the repository:
git clone https://github.com/ElenaManukyan/Difference-Calculator.git
- Navigate to the project directory:
cd Difference-Calculator
- Install dependencies:
npm install
The project uses ESLint with Airbnb's coding standards. To lint the code, run:
npx eslint .
or:
make lint
Tests are written using the Jest framework. To run all tests, execute:
npm test
or:
make test
To ensure consistent code style, use Prettier:
npx prettier --write .
The gendiff command compares two files and outputs their differences.
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