pull-pairs

1.0.0 • Public • Published

pull-pairs

pull stream every pair of values through a function.

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

pull(
  pull.values([1,2,3,4,5]),
  pairs(function mapper (a, b) {
    console.log([a, b])
    //return the normal output.
    return b
  }),
  pull.drain()
)

console.log output will be:

null 1
1 2
2 3
3 4
4 5

the return value of mapper will be the output of the stream. if the return value is undefined then

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i pull-pairs

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • dominictarr