# @anastassin/difference-calculator

> [![Maintainability](https://api.codeclimate.com/v1/badges/31863e92491f55bbfc40/maintainability)](https://codeclimate.com/github/AnastasiyaYS/project-lvl2-s475/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/31863e92491f55bbfc40/te

Latest version **1.6.0** (published 2019-09-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install @anastassin/difference-calculator
pnpm add @anastassin/difference-calculator
yarn add @anastassin/difference-calculator
bun add @anastassin/difference-calculator
```

Provides the command `gendiff`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.0 |
| Published | 2019-09-19 |
| First published | 2019-08-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 34.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | anastassin |

## Links

- npm: https://www.npmjs.com/package/@anastassin/difference-calculator
- Repository: https://github.com/AnastasiyaYS/project-lvl2-s475
- Homepage: https://github.com/AnastasiyaYS/project-lvl2-s475#readme
- Issues: https://github.com/AnastasiyaYS/project-lvl2-s475/issues
- npm.io page: https://npm.io/package/@anastassin/difference-calculator

## Dependencies (5)

- [ini](https://npm.io/package/ini.md) ^1.3.5
- [fs-js](https://npm.io/package/fs-js.md) ^1.0.6
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.13.1
- [commander](https://npm.io/package/commander.md) ^3.0.0

## Recent versions

- 1.6.0 (latest) — 2019-09-19
- 1.5.5 — 2019-09-18
- 1.5.4 — 2019-09-18
- 1.5.3 — 2019-09-18
- 1.5.2 — 2019-09-17
- 1.5.1 — 2019-09-17
- 1.5.0 — 2019-09-17
- 1.4.0 — 2019-09-16
- 1.3.0 — 2019-09-10
- 1.2.0 — 2019-09-10
- 1.1.0 — 2019-08-29

## README

# project-lvl2-s475
[![Maintainability](https://api.codeclimate.com/v1/badges/31863e92491f55bbfc40/maintainability)](https://codeclimate.com/github/AnastasiyaYS/project-lvl2-s475/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/31863e92491f55bbfc40/test_coverage)](https://codeclimate.com/github/AnastasiyaYS/project-lvl2-s475/test_coverage) [![Build Status](https://travis-ci.org/AnastasiyaYS/project-lvl2-s475.svg?branch=master)](https://travis-ci.org/AnastasiyaYS/project-lvl2-s475)

Compares two configuration files and shows a difference.

## Setup

```sh
$ sudo npm install -g @anastassin/difference-calculator
```

## Usage

### **CLI application**
```sh
Usage: gendiff [options] <firstConfig> <secondConfig>

Options:

  -V, --version        output the version number
  -f, --format [type]  Output format
  -h, --help           output usage information
```

### **Library**
```sh
import genDiff from 'genDiff';
const diff = genDiff(pathToFile1, pathToFile2);
console.log(diff);
```

## Run

### **Compare flat JSON files**
```sh
$ gendiff firstPath.json secondPath.json
```
[![asciicast](https://asciinema.org/a/264895.svg)](https://asciinema.org/a/264895)

### **Compare flat YAML files**
```sh
$ gendiff firstPath.yml secondPath.yml
```
[![asciicast](https://asciinema.org/a/267043.svg)](https://asciinema.org/a/267043)

### **Compare flat INI files**
```sh
$ gendiff firstPath.ini secondPath.ini
```
[![asciicast](https://asciinema.org/a/267322.svg)](https://asciinema.org/a/267322)

### **Compare tree files (JSON, YAML, INI)**
```sh
$ gendiff firstPath.json secondPath.json
```
&nbsp;or
```sh
$ gendiff firstPath.yml secondPath.ini
```
[![asciicast](https://asciinema.org/a/268758.svg)](https://asciinema.org/a/268758)

### **Сhoose one of unstructured output formats: tree (by default) or plain**
Display comparison in tree format (by default)
```sh
$ gendiff firstPath.yml secondPath.ini
```
Display comparison in plain format
```sh
$ gendiff -f plain firstPath.json secondPath.ini
```
[![asciicast](https://asciinema.org/a/269304.svg)](https://asciinema.org/a/269304)

### **Choose JSON output format**
```sh
$ gendiff -f json firstPath.ini secondPath.yml
```

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