Skip to content

This is a simple console program to compare two files in format JSON or YAML

Notifications You must be signed in to change notification settings

VladimirMastepanov/JsonYamlDiff

Repository files navigation

Maintainability Test Coverage


JsonYamlDiff – Command-Line Tool for Comparing JSON and YAML Files

JsonYamlDiff is a simple and efficient command-line tool designed to compare JSON and YAML files, highlighting differences in both structure and content. It provides an easy way to spot changes between configuration files or data sets, making it an essential utility for developers and system administrators.


Features

  • Supports JSON and YAML formats: Easily compare JSON and YAML files side-by-side.
  • Detailed comparison: Identifies and displays differences in file structure, values, and types.
  • Command-line interface: Simple CLI commands for quick comparisons.
  • Cross-platform: Works on any system that supports Node.js.

Installation

To use this tool, you'll need Node.js installed on your machine. Then, install the package globally.

# Clone the repository
 $ git clone git@github.com:VladimirMastepanov/JsonYamlDiff.git

# Navigate to the project directory
 $ cd JsonYamlDiff

# Install dependencies
 $ make install-deps

Usage

To compare two files, run the gendiff command:

 $ gendiff <file1> <file2>

For example:

 $ gendiff file1.yml file2.yml

asciicast

Command-line options:

 -V, --version        output the version number
 -f, --format <type>  output format
 -h, --help           display help for command

Technologies and Dependencies

  • Commander – A popular tool for building CLI applications.
  • js-yaml – For parsing and handling YAML files.
  • lodash – Used for deep object comparison.
  • Jest – For unit testing.

Development Tools

  • ESLint (Airbnb config) – For code style enforcement and linting.
  • Jest – For writing unit tests to ensure the reliability of the tool.

More examples of the application in action, showcasing output in various formatting options:

  • default:
 $ gendiff <filepath1> <filepath2>

asciicast

  • plain:
 $ gendiff -f plain <filepath1> <filepath2>

asciicast

  • JSON:
 $ gendiff -f json <filepath1> <filepath2>

asciicast

About

This is a simple console program to compare two files in format JSON or YAML

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published