webdb81 / frontend-project-46

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Utility for comparison of two structured-data files with displaying differences

Hexlet tests and linter status:

Actions Status Maintainability Test Coverage Jest Node CI

Prerequisites

  • Node.js version 16 or higher.
  • Terminal for performing files comparison via command line interface (CLI).
  • Unix-like operating system.

Install

  1. Clone project to your computer.
# via HTTPS
git clone https://github.com/webdb81/frontend-project-46.git

# or via Github CLI
gh repo clone webdb81/frontend-project-46
  1. Go to the main directory of cloning project.
cd frontend-project-46
  1. Install all the necessary dependencies.
make install
  1. Linking package to be able to run commands. This command may require admin rights aka sudo.
make link

Viewing the help about the utility:

gendiff -h

asciicast

Usage example

Comparison of flat structures

gendiff filePath1.json filePath2.json

asciicast

Recursive comparison

Recursive comparison by default formatter styling:

gendiff __fixtures__/file1.json __fixtures__/file2.json
gendiff __fixtures__/file1.yml __fixtures__/file2.yml

Recursive comparison with setting formatter styling:

gendiff --format stylish __fixtures__/file1.json __fixtures__/file2.json
gendiff --format stylish __fixtures__/file1.yml __fixtures__/file2.yml

asciicast

«Flat» comparison for json-files

gendiff -f plain __fixtures__/file1.json __fixtures__/file2.json

asciicast

«Flat» comparison for yaml-files

gendiff -f plain __fixtures__/file1.yml __fixtures__/file2.yml

asciicast

Output of the compared data in a structured json-format

gendiff -f json __fixtures__/file1.json __fixtures__/file2.json
gendiff -f json __fixtures__/file1.yml __fixtures__/file2.yml

asciicast

About


Languages

Language:JavaScript 96.9%Language:Makefile 3.1%