Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timursus/differencecalculator
Compare configuration files
https://github.com/timursus/differencecalculator
cli comparison hexlet-projects jest nodejs testing trees utility
Last synced: about 1 month ago
JSON representation
Compare configuration files
- Host: GitHub
- URL: https://github.com/timursus/differencecalculator
- Owner: timursus
- Created: 2020-03-29T16:27:22.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T18:19:12.000Z (almost 2 years ago)
- Last Synced: 2024-09-28T18:02:55.666Z (3 months ago)
- Topics: cli, comparison, hexlet-projects, jest, nodejs, testing, trees, utility
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@timursus/gendiff
- Size: 1.91 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Difference calculator
[![Workflow](https://github.com/timursus/frontend-project-lvl2/workflows/Node%20CI/badge.svg)](https://github.com/timursus/frontend-project-lvl2/actions)
[![Maintainability](https://api.codeclimate.com/v1/badges/477e5fd164b0049a52d6/maintainability)](https://codeclimate.com/github/timursus/frontend-project-lvl2/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/477e5fd164b0049a52d6/test_coverage)](https://codeclimate.com/github/timursus/frontend-project-lvl2/test_coverage)Compares two configuration files and shows a difference.
- Supports different data formats: JSON, YAML, INI.
- Shows a report in plain text, pretty, or json formats.
- Works as CLI utility or as node.js module.
## Getting started
```bash
npm install -g @timursus/gendiff
```
> Requires [Node](https://nodejs.org/) v13+## Usage
```
gendiff [options]Options:
-h, --help display help for command
-V, --version output the version number
-f, --format output format [pretty, plain, json] (default: "pretty")
--color enable color highlighting for "pretty" or "plain" output
```## Demonstrations of use
Comparison of nested structures. Color output.
[![asciicast_gendiff](https://asciinema.org/a/FOPjvaMJ5HAkFHHOmiwnIzHcc.svg)](https://asciinema.org/a/FOPjvaMJ5HAkFHHOmiwnIzHcc)### API
**gendiff (filepath1, filepath2 [, outputFormat = 'json'])**By default, `gendiff` returns a diff tree in json string
``` javascript
import gendiff from '@timursus/gendiff';const diff = gendiff(filepath1, filepath2);
```