A CLI tool that finds differences between two configuration files or data structures. This is a common task for which there are numerous online services, such as jsondiff.com. Useful for testing, debugging, or tracking changes in config files.
- Support for different input formats: YAML, JSON
- Output in
plain,stylish, andJSONformats
You need to have Node.js installed. If it's not installed, use the installation guide. To check your Node.js version, use the command node -v.
- Clone the repository:
git clone https://github.com/mxclg/difference-finder-cli
- Navigate to the project directory
cd difference-finder-cli
- Install dependencies:
npm install
- Link the package locally:
npm link
Run
gendiff [options] <filepath1> <filepath2>
Show help
gendiff -h
Example usage
gendiff --format plain file1.json file2.json
and you'll see =>
Usage: gendiff [options] <filepath1> <filepath2>
Compares two configuration files and shows a difference.
Options:
-V, --version output the version number
-f, --format <type> output format (default: "stylish")
-h, --help output usage information
- diff report – flat JSON files
- diff report – flat YAML files
- diff report – nested files in
stylishformat - diff report – two nested files in
plainformat - diff report – nested files in
jsonformat