JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 328708
  • Score
    100M100P100Q154255F
  • License MIT

Package Exports

  • pull-window

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pull-window) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

pull-window

group pull-stream chunks into length or time windows.

Example

Group data coming out of a pull-stream. If the pull-stream rate is not consistent, buffer items, but do not buffer them for very long.

var pull   = require('pull-stream')
var window = require('pull-window')

pull.Source(function () {
  var i = 0
  return function (abort, cb) {
    setTimeout(function () {
      cb(null, i++)
    }, Math.random() * 200)
  }
})()
.pipe(window(10, 200))
.pipe(pull.log())

License

MIT