npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

level-value

1.1.2

@juliangruber

npmHomeRepoSnykSocket
Downloads:2
$ npm install level-value
DailyWeeklyMonthlyYearly

level-value

Subscribe to a leveldb value.

  • exposes put, batch and del changes through one unified interface
  • accepts RegExps
  • performs an initial get for the value (except with RegExp)

Usage

const subscribe = require('level-value')

subscribe(db, 'key', value => {
  console.log(value)  
}).off()

// Alternative EventEmitter API

const sub = subscribe(db, 'key')
sub.on('value', console.log)
sub.off()

Install

$ npm install level-value

API

subscribe(db, key[, fn])

#on('value', fn)

#off()

License

MIT