# level-post

> get consistent post hooks for leveldb.

Latest version **1.0.7** (published 2018-02-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install level-post
pnpm add level-post
yarn add level-post
bun add level-post
```

## 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.7 |
| Published | 2018-02-09 |
| First published | 2013-06-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Dominic Tarr |
| Maintainers | dominictarr |

## Links

- npm: https://www.npmjs.com/package/level-post
- Repository: https://github.com/dominictarr/level-post
- Issues: https://github.com/dominictarr/level-post/issues
- npm.io page: https://npm.io/package/level-post

## Dependencies (1)

- [ltgt](https://npm.io/package/ltgt.md) ^2.1.2

## Recent versions

- 1.0.7 (latest) — 2018-02-09
- 1.0.5 — 2016-07-31
- 1.0.4 — 2014-07-17
- 1.0.3 — 2013-07-08
- 1.0.2 — 2013-06-18
- 1.0.1 — 2013-06-17
- 1.0.0 — 2013-06-17

## README

# level-post

get consistent post hooks for leveldb.

[![travis](https://travis-ci.org/dominictarr/level-post.png?branch=master)
](https://travis-ci.org/dominictarr/level-post)

[![testling](http://ci.testling.com/dominictarr/level-post.png)
](http://ci.testling.com/dominictarr/level-post)

``` js
var level = require('level')

var db = level('/tmp/whatever-db')

post(db, function (op) {
  //this is called after every put, del, or batch
  console.log(op)
})

db.put('foo', 'bar', function (err) {
  //...
})
```

# methods

## post(db, opts={}, cb)

Create a hook to listen for database events matching the constraints in `opts`.
`cb(op)` fires for each matching operation for `op`, an object with `type`,
`key`, and `value` properties.

You can use these keys as constraints, just like level core:

* `opts.gte`, `opts.start`, `opts.min` - greater than or equal to
* `opts.gt` - greater than
* `opts.lte`, `opts.end`, `opts.max` - less than or equal to
* `opts.lt` - less than

You can also specify a keyEncoding with `opts.keyEncoding`. If there was a
keyEncoding set up by leveldb in the constructor (at `db.options.keyEncoding`),
that one will be used.

## License

MIT

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