# diff-objects

> compares two objects to give a difference

Latest version **1.0.6** (published 2018-02-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install diff-objects
pnpm add diff-objects
yarn add diff-objects
bun add diff-objects
```

## 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.0.6 |
| Published | 2018-02-23 |
| First published | 2018-02-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | dydaev |
| Maintainers | dydaev |
| Keywords | javascript, differenceObjects, compares |

## Links

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

## Dependencies (1)

- [deep-equal](https://npm.io/package/deep-equal.md) ^1.0.1

## Recent versions

- 1.0.6 (latest) — 2018-02-23
- 1.0.5 — 2018-02-23
- 1.0.4 — 2018-02-21
- 1.0.3 — 2018-02-21
- 1.0.2 — 2018-02-21
- 1.0.1 — 2018-02-21
- 1.0.0 — 2018-02-20

## README

# diffObjects
function returning difference of two objects

example:

const object1 = {
  a: 1,
  b: 2,
  c: 3,
};

const object2 = {
  a: 1,
  c: 4,
  d: 5,
};

const result = diffObjects(object1, object2);
/*
result = {
  added: {
    d: 5,
  },
  saved: {
    a: 1,
  },
  updated: {
    c: 4,
  },
  deleted: {
    b: 2,
  },
};
*/

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