pull-map
Create sync, async, or through maps in pull-streams
var map =
The map
function is like pull.map
and pull.asyncMap
combined, by sync or async depending if the done
callback is provided. There is also map.through
, which passes data on undefined
.
Installation
$ npm install --save pull-map
Usage
map(fn)
A through stream that maps values with map(x => ...)
or async map with map((x, cb) => ...)
. Async map's callback takes cb(err, data)
. One function for all your pull-stream mapping needs!
// A sync mapvar foo = // An async mapvar bar =
map.through(fn)
The same sync/async functionality as map
, except passes on data if it receives undefined
. Useful when you only want to replace some of the data in the pipeline.
The sync and async map methods behind map
.
License
MIT © Jamen Marz