Skip to content

Project "Difference calculator" (Hexlet's educational project)

Notifications You must be signed in to change notification settings

Teihden/frontend-project-46

Repository files navigation

Project "Difference calculator"

Actions Status CI Maintainability Test Coverage

About

"Difference calculator" is a program that determines the difference between two data structures. This is a popular task, for which there are many online services, for example https://www.jsondiff.com. A similar mechanism is used when outputting tests or when automatically tracking changes in configuration files.

Features of the utility:

  • Supports various input formats: yaml, json;
  • Report generation as plain text, stylish and json.

Examples of use:

  1. "Comparison of flat files (JSON)"
  2. "Comparison of flat files (YAML)"
  3. "Comparison of nested files with stylish format"
  4. "Comparison of nested files with plain format"
  5. "Comparison of nested files with json format"

Usage

You should have Node.js installed before proceeding. Only test JS against v18 and on macOS.

# Clone the repo
git clone https://github.com/Teihden/frontend-project-46
cd frontend-project-46

# Install dependencies
make install

# Run
make gendiff

CLI

# Runs npm-publish with flag (--dry-run)
make publish

# Runs Eslint against source code for quality
make lint

# Runs Jest
make test

# Runs Jest in code coverage mode
make test-coverage

# Runs Jest in watch mode
make watch

Comparison of flat files (JSON)

A simple comparison of 2 files with JSON extension without specifying the output data format.

asciicast

Comparison of flat files (YAML)

A simple comparison of 2 files with YAML extension without specifying the output data format.

asciicast

Comparison of nested files with 'stylish' format

Comparison of 2 files with JSON, YAML extension with 'stylish' output data format.

asciicast

Comparison of nested files with 'plain' format

Comparison of 2 files with JSON, YAML extension with 'plain' output data format.

asciicast

Comparison of nested files with 'json' format

Comparison of 2 files with JSON, YAML extension with 'json' output data format.

asciicast