An open API service indexing awesome lists of open source software.

https://github.com/dimfeld/pull-map-async-done

Asynchronous map with done/flush callback for pull streams
https://github.com/dimfeld/pull-map-async-done

Last synced: over 1 year ago
JSON representation

Asynchronous map with done/flush callback for pull streams

Awesome Lists containing this project

README

          

# pull-map-async-map-done

This is based on the async-map through stream from the core pull-stream module, with the addition of a done callback that can optionally pass on a final value.

```
var asyncMap = require('pull-async-map-done');

asyncMap(
function map(data, cb) {
cb(null, `Value: ${data}`);
},
function done(err, cb) {
if(err) console.log("Error!");
cb(null, "Done"); // or cb(null) to not pass through a final piece of data
}
)
```