Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

juliangruber/level-value

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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