# 2diff

> Node.js object difference

Latest version **3.1.2** (published 2022-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install 2diff
pnpm add 2diff
yarn add 2diff
bun add 2diff
```

## 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 | 3.1.2 |
| Published | 2022-02-21 |
| First published | 2022-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dimitry Ivanov |
| Maintainers | ivanoff |
| Keywords | diff, object difference |

## Links

- npm: https://www.npmjs.com/package/2diff
- Repository: https://github.com/ivanoff/2diff
- Homepage: https://github.com/ivanoff/2diff#readme
- Issues: https://github.com/ivanoff/2diff/issues
- npm.io page: https://npm.io/package/2diff

## Dependencies (1)

- [flattening](https://npm.io/package/flattening.md) ^2.4.2

## Recent versions

- 3.1.2 (latest) — 2022-02-21
- 3.1.1 — 2022-02-21
- 2.3.1 — 2022-02-21

## README

# Node.js object difference

## 2diff

## Instalation

`npm i -S 2diff`

## Usage

```javascript
const diff = require('2diff');

const before = {c: 3, a: 1, b: '2', e: {x: 9}};
const after = {a: 1, b: 1, e: {x: 9}, f: {x: 9}};

const result = diff(before, after);

console.log(result);
```

Output:

```
[
  { removed: true, key: 'c', value: 3 },
  { removed: true, key: 'b', value: '2' },
  { added: true, key: 'b', value: 1 },
  { added: true, key: 'f.x', value: 9 }
]
```

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