Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

level-live-stream

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

level-live-stream

Stream live changes from levelup.

Source
npmnpm
Version
1.4.3
Version published
Weekly downloads
101
40.28%
Maintainers
1
Weekly downloads
 
Created
Source

level-live-stream

Stream live changes from levelup.

Build Status

Works just like LevelUp#readStream except instead 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 (err, db) {

  require('level-live-stream')(db)

  db.liveStream()
    .on('data', console.log)

  setInterval(function () {
    db.put('time', new Date().toString())

  }, 1000)

})

options

LiveStream(db, {
  tail: true,   //follow
  old : true,   //get old records from data base
                //if old=false you will only get live updates
  min : loKey,  //lowest key in range
  max : hiKey,  //highest key in range
  reverse: true //stream in reverse (only applies to old records)
})

License

MIT

FAQs

Package last updated on 30 May 2013

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