level-live-stream

Stream live changes from levelup.

level-live-stream

Stream live changes from levelup.

Works just like LevelUp#readStream except in stead of ending, it will stay open and stream changes to the database as they are inserted!

Just like the couchdb changes feed, but for any arbitary range of keys!

see also, level-livefeed for the same idea, but with a streams2 api.

 
var levelup = require('levelup')
 
var levelup('/tmp/level-live-stream', 
  {createIfMissing: true}, function (errdb) {
 
  require('level-live-stream')(db)
 
  db.liveStream()
    .on('data', console.log)
 
  setInterval(function () {
    db.put('time', new Date().toString())
 
  }, 1000)
 
})
 

MIT