Socket
Socket
Sign inDemoInstall

level-post

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

level-post

get consistent post hooks for leveldb.


Version published
Weekly downloads
28K
increased by5.11%
Maintainers
1
Weekly downloads
 
Created
Source

level-post

get consistent post hooks for leveldb.

travis

testling

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

FAQs

Package last updated on 09 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc