Hexlet educational project
A JavaScript program that compares data in two files and shows the difference. GenDiff can work with JSON and YAML formats and can be used both as a CLI tool and a Node.js module.
Educational project from Hexlet programming school.
To install GenDiff, download source code and run the following command in repo directory:
make install
In both CLI and node module modes GenDiff takes as arguments two paths to files and option of formatting style. There are 3 formatting styles - "stylish" (default), "plain" and "JSON".
"Stylish" and "plain" formats of output asciinema
JSON output asciinema
Usage: gendiff [options] <filepath1> <filepath2>
Compares two configuration files and shows a difference.
Arguments:
filepath1 path to first file
filepath2 path to second file
Options:
-V, --version output the version number
-f, --format <format> output format (default: "stylish")
-h, --help display help for command
In directory of your project run:
npm install <path to gendiff repo>
in your JS file:
import genDiff from '@hexlet/code';
const diff = genDiff(<filepath1>, <filepath2>, <formatName>);