Skip to content

HaimOzer/frontend-project-46

Repository files navigation

Hexlet tests and linter status:

Actions Status Node CI Maintainability Test Coverage

Project Name: Difference Generator

"File Harmony: Making Differences Visible with our CLI Tool"

project's logo

Description

Difference Generator is a Command Line Interface (CLI) utility designed to generate and display differences between two files. This tool can be particularly useful for developers who want to compare configuration files, JSON files, or any other structured data.

Supported files and formats:

  • Input formats: .json, .yaml, .yml;
  • Output formats: stylish, plain, JSON.

Installation

  1. Clone the repository: git clone git@github.com:HaimOzer/frontend-project-46.git;
  2. Install project dependencies: make install;
  3. Install the package with the utility locally: npm link.

Usage

After installation, you can learn how to use the utility using the gendiff command and the -h flag: gendiff -h.

$ gendiff -h
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
  -h, --help          display help for command

-f --format
Report format. Possible values:

  • stylish (default option)
    Structured output. example
  • plain
    Report in plain text. List includes only changed, added or deleted keys, unchanged keys are skipped. example
  • json
    Output in json format. example

filepath1, filepath2
Path to files to compare. Both absolute and relative paths are acceptable.

Run the tests: make test.

Run the linter: make lint.

Put your files to fixtures directory and run - example gendiff file1.json file2.yaml


Examples

gendiff-info and compare flat objects

asciicast

stylish format of nested objects

asciicast

plain format of nested objects

asciicast

json format of nested objects

asciicast

License

This project is licensed under the ISC License.

Feel free to customize the content based on your project's specific details and requirements.

About

A CLI tool for comparing differences in files.

Resources

Stars

Watchers

Forks

Packages

No packages published