# @timursus/gendiff

> Compares two configuration files and shows a difference.

Latest version **1.1.0** (published 2020-12-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install @timursus/gendiff
pnpm add @timursus/gendiff
yarn add @timursus/gendiff
bun add @timursus/gendiff
```

Provides the command `gendiff`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-12-26 |
| First published | 2020-12-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 13 |
| Dependencies | 5 |
| Unpacked size | 8.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Timur Akhmetov |
| Maintainers | timursus |
| Keywords | hexlet-project, gendiff, files difference, cli |

## Links

- npm: https://www.npmjs.com/package/@timursus/gendiff
- Repository: https://github.com/timursus/frontend-project-lvl2
- Homepage: https://github.com/timursus/frontend-project-lvl2#readme
- Issues: https://github.com/timursus/frontend-project-lvl2/issues
- npm.io page: https://npm.io/package/@timursus/gendiff

## Dependencies (5)

- [ini](https://npm.io/package/ini.md) ^2.0.0
- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.20
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.14.1
- [commander](https://npm.io/package/commander.md) ^6.2.1

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2020-12-26
- 1.0.2 — 2020-12-15

## 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] <filepath1> <filepath2>

Options:
  -h, --help           display help for command
  -V, --version        output the version number
  -f, --format <type>  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);
```

---
_Source: https://npm.io/package/@timursus/gendiff · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
