Socket
Book a DemoInstallSign in
Socket

changes-feed

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

changes-feed

Basic changes-feed implementation that runs on top of leveldb

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
14
250%
Maintainers
1
Weekly downloads
 
Created
Source

changes-feed

Basic changes-feed implementation that runs on top of leveldb

npm install changes-feed

build status

Usage

var changes = require('changes-feed')
var feed = changes(db) // db is a levelup

feed.createReadStream({live:true})
  .on('data', function(data) {
    console.log('someone appended:', data)
  })

feed.append('hello')

API

feed.append(value)

Append a new value to the changes feed. The value should be a string or buffer

stream = feed.createReadStream([options])

Stream out entries from the log. Per default this will stream out all entries. Options include:

{
  live: true,   // keep the stream open,
  since: number // only get changes >number
}

A stream data object looks like this

{
  change: number, // incrementing change number
  value: value    // the value appended
}

License

MIT

FAQs

Package last updated on 06 Feb 2015

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