Socket
Book a DemoInstallSign in
Socket

pull-next

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-next

read from one pull-stream, then the next, then the next...

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
78
27.87%
Maintainers
1
Weekly downloads
 
Created
Source

pull-next

read from one pull-stream, then the next, then the next...

when one stream end (unless it errored) call a function to get the next stream. much like pull-cat except creates streams by calling a function instead of takeing them out of an array.

in particular, this is useful for making a read stream that reconnects to a source.

example

create a stream that reads from a leveldb 100 items at a time.

var next = require('pull-next')
var pl = require('pull-level')
var db = require('level')(path_to_level)

function resume () {
  var last = null
  return Next(function () {
    return pull(
      pl.read(db, {gt: last && last.key, limit: 100}),
      pull.through(function (data) { last = data })
    )
  })
}

hint: this might be even more useful over multilevel

License

MIT

FAQs

Package last updated on 24 Jun 2017

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