JSPM

pull-promise-map-done

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

Map Pull Stream with Promise support and done callback

Package Exports

  • pull-promise-map-done

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-promise-map-done) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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
    }
)