# mongoose-human-diff-plugin

> See how your documents change in human readable form

Latest version **0.1.0** (published 2020-02-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install mongoose-human-diff-plugin
pnpm add mongoose-human-diff-plugin
yarn add mongoose-human-diff-plugin
bun add mongoose-human-diff-plugin
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2020-02-25 |
| First published | 2020-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 2 |
| Unpacked size | 13.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Spencer Snyder |
| Maintainers | spence-s |
| Keywords | deep-diff, deep-diff, human-object-diff, lass, mongoose, mongoose-diff, mongoose-diff-plugin, mongoose-plugin, xo |

## Links

- npm: https://www.npmjs.com/package/mongoose-human-diff-plugin
- Repository: https://github.com/Spence-S/mongoose-human-diff-plugin
- Issues: https://github.com/Spence-S/mongoose-human-diff-plugin/issues
- npm.io page: https://npm.io/package/mongoose-human-diff-plugin

## Dependencies (2)

- [captain-hook](https://npm.io/package/captain-hook.md) ^0.0.3
- [human-object-diff](https://npm.io/package/human-object-diff.md) ^1.0.0

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2020-02-25
- 0.0.1 — 2020-02-08

## README

# mongoose-human-diff-plugin

[![build status](https://img.shields.io/travis/com/Spence-S/mongoose-human-diff-plugin.svg)](https://travis-ci.com/Spence-S/mongoose-human-diff-plugin)
[![code coverage](https://img.shields.io/codecov/c/github/Spence-S/mongoose-human-diff-plugin.svg)](https://codecov.io/gh/Spence-S/mongoose-human-diff-plugin)
[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)
[![license](https://img.shields.io/github/license/Spence-S/mongoose-human-diff-plugin.svg)](LICENSE)
[![npm downloads](https://img.shields.io/npm/dt/mongoose-human-diff-plugin.svg)](https://npm.im/mongoose-human-diff-plugin)

> See how your documents change in human readable form


## Table of Contents

* [Install](#install)
* [Usage](#usage)
* [About](#about)
* [Contributors](#contributors)
* [License](#license)


## Install

[npm][]:

```sh
npm install mongoose-human-diff-plugin
```

[yarn][]:

```sh
yarn add mongoose-human-diff-plugin
```


## Usage

```js
const MongooseHumanDiffPlugin = require('mongoose-human-diff-plugin');
const mongoose = require('mongoose');

const MySchema = new mongoose.schema({
  ...
});

const changeCallback = diff => console.log(diff.join('\n'))

const options = {}

MySchema.plugin(mongooseHumanDiffPlugin(changeCallback), options)
```


## About

`mongoose-human-diff-plugin` is a wrapper around [human-object-diff](https://github.com/Spence-S/human-object-diff)

All options are directly passed to the [human-object-diff](https://github.com/Spence-S/human-object-diff#configuring) library.

Use it to respond to changes in your documents.

For Example, let's say you have a User Schema where the users can change personal information.
You could use `mongoose-human-diff-plugin` to send an email to users alerting them of the changes.
Simply, add the email logic in your callback, and use the human readable changes to alert them.
This could be applied to changes in schemas that you need to alert any one about!


## Contributors

| Name               | Website                    |
| ------------------ | -------------------------- |
| **Spencer Snyder** | <http://spencersnyder.io/> |


## License

[MIT](LICENSE) © [Spencer Snyder](http://spencersnyder.io/)


## 

[npm]: https://www.npmjs.com/

[yarn]: https://yarnpkg.com/

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