Map over an array and return a Promise.
$ npm install promise-map
const map = require('promise-map')
Promise.resolve([1, 2, 3])
.then(map((val) => val + 1))
// => [2, 3, 4]
This module is basically equivalent to bluebird.map
, but it's handy
to have the one function you need instead of a kitchen sink. Modularity!
Especially handy if you're serving to the browser and need to reduce your
javascript bundle size.
Works great in the browser with browserify!