Skip to content

Difference calculator is a command line interface utility that determines the difference between two data structures.

Notifications You must be signed in to change notification settings

sharaendy/Gendiff-CLI-App

Repository files navigation

Tests and Linter status:

Actions Status Node CI

CodeClimate: Test Coverage and Maintainability:

Test Coverage Maintainability

Installation

Description

The CLI-utility compares two configuration files with the format .json, .yaml or .yml. The application takes two arguments on the command line - the paths to these files (it works both with relative and absolute paths) and outputs the result of the comparison in the specified format.

  • Using:

gendiff [options] <filepath1> <filepath2>
  • Options:

-h, --help 

​ select format:

-f, --format <format>

​ available formats:

stylish (default)
plain
json
  • Example

gendiff -f stylish <filepath1> <filepath2>

Features

  • Crossplatform;
  • The code is built in an immutable style;
  • Implemented code testing ( Jest );
  • On Codeclimate the coverage is checked by tests, the badge displays it;
  • Github Actions checks coding standards (eslint airbnb) and runs tests;
  • The code is intentionally (for training purposes) built on variables, loops, as well as higher-order functions and recursion;
  • The internal representation is a tree, where each element is a node that has its own type;

Demonstration

1. Comparison of "flat" .json files (stylish format);

asciicast

2. Comparison of "flat" .yaml and .yml files (format stylish);

asciicast

3. Comparison of multi-level .json files (format stylish);

asciicast

4. Comparison of multi-level .yaml and .yml files (format stylish);

asciicast

5. Comparison of multi-level .json files (plain format);

asciicast

6. Comparison of multi-level .yaml and .yml files (plain format);

asciicast

7. Comparison of multi-level .json files (json output format);

asciicast

8. Comparison of multi-level .yaml and .yml files (json output format);

asciicast

Authored by

Шараевский Андрей (sharaendy)

[email protected]

About

Difference calculator is a command line interface utility that determines the difference between two data structures.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published