0.1.0 • Published 10 years ago

pull-array-collate v0.1.0

Weekly downloads
4
License
-
Repository
github
Last release
10 years ago

pull-array-collate

Collate arrays and send them downstream.

This pull-stream is combination of a Sink and a Through. It will sink all the objects from upstream, once upstream reached it's end, it'll send downstream an array.

Example

var pull = require("pull-stream");
var arrCollateStream = require("pull-array-collate");

function plusOneMapper(num) {
  return num+1;
}

pull(
  pull.values([1,2,3,4]),
  pull.map(plusOneMapper),
  arrCollateStream(),
  pull.drain(console.log)
)

Result:

[ 2, 3, 4, 5 ]

install

With npm do:

npm install pull-array-collate

license

MIT