# what-changed

> Provides an overview of how a value changed since the last time you checked.

Latest version **2.3.1** (published 2018-09-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install what-changed
pnpm add what-changed
yarn add what-changed
bun add what-changed
```

## 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 | 2.3.1 |
| Published | 2018-09-24 |
| First published | 2014-07-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 9.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | korynunn |

## Links

- npm: https://www.npmjs.com/package/what-changed
- Repository: https://github.com/KoryNunn/what-changed
- Issues: https://github.com/KoryNunn/what-changed/issues
- npm.io page: https://npm.io/package/what-changed

## Dependencies (3)

- [clone](https://npm.io/package/clone.md) ^1.0.2
- [deep-equal](https://npm.io/package/deep-equal.md) ^0.2.1
- [cyclic-deep-equal](https://npm.io/package/cyclic-deep-equal.md) ^1.0.0

## Recent versions

- 2.3.1 (latest) — 2018-09-24
- 2.3.0 — 2018-07-23
- 2.2.0 — 2016-04-04
- 2.1.5 — 2016-01-21
- 2.1.4 — 2015-08-27
- 2.1.3 — 2015-07-27
- 2.1.2 — 2015-04-24
- 2.1.1 — 2015-04-08
- 2.1.0 — 2015-04-08
- 2.0.0 — 2015-01-20
- 1.0.1 — 2014-07-09
- 1.0.0 — 2014-07-08

## README

# what-changed

Provides an overview of how a value changed since the last time you checked.

## usage

install:

    npm install what-changed

require:

    var WhatChanged = require('what-changed');

instantiate:

    var state = new WhatChanged([initial value]);

change the value, and get the change overview:

    state.update(123);

    // -> {type: true, value: true}


The following describes expected output based on how a value changes:

### 1, 1

    {}

### 1, 2

    {
        value: true,
        any: true
    }

### 1, true

    {
        value: true,
        type: true,
        any: true
    }

### 1, '1'

    {
        type: true,
        any: true
    }

### {a:1}, {a:1} (same instance)

    {}

### {a:1}, {a:1} (different instance)

    {
        reference: true
    }

### {a:1}, {b:1} (same instance)

    {
        keys: true,
        structure: true,
        any: true
    }


### {a:{b:1}}, {a:{b:2}} (same instance)

    {
        structure: true,
        any: true
    }


### {a:1}, {b:1} (different instance)

    {
        reference: true,
        keys: true,
        structure: true,
        any: true
    }

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