Skip to content

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.io

Notifications You must be signed in to change notification settings

sirflyingv/json-yml-diff-finder

Repository files navigation

GenDiff

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.

Hexlet tests and linter status:

Actions Status Maintainability Test Coverage tests

Installation

To install GenDiff, download source code and run the following command in repo directory:

make install

Usage

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

CLI

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

Node.js module

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>);

About

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.io

Resources

Stars

Watchers

Forks

Packages

No packages published