pull-offset-limit
A pull-stream that filters until X elements, and stops streaming after Y elements.
Last updated 9 years ago by jdvorak .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install pull-offset-limit 
SYNC missed versions from official npm registry.

pull-offset-limit

npm version build status test coverage downloads js-standard-style

A pull-stream that filters until X elements, and stops streaming after Y elements. Useful for pagination purposes.

Usage

const pull = require('pull-stream')
const split = require('pull-split')
const offsetLimit = require('pull-offset-limit')
 
pull(
  textStream, // some text stream
  split(), // split on new lines
  offsetLimit(5, 20), // after 5 lines, take 20
  output
)

API

offsetLimit = require('pull-offset-limit')(offset, limit, onLimit)

Create a new offsetLimit through stream.

  • offset: if set, filters stream until offset is reached
  • limit: if set, stops stream when limit is reached
  • onLimit: if set, runs when limit is reached

Installation

$ npm install pull-offset-limit

License

MIT

Current Tags

  • 1.1.1                                ...           latest (9 years ago)

3 Versions

  • 1.1.1                                ...           9 years ago
  • 1.1.0                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (4)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |