Package Exports
- promise-serial-exec
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 (promise-serial-exec) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
promise-serial-exec

Execute promises sequentially, aka sequential Promise.all.
Can be useful for CPU-intensive operations, databases, scrapping...
Usage
const serialExec = require('promise-serial-exec')
const urls = [
url1,
url2,
url3
];
// make the promise callables so they're executed on-demand
const promiseCalls = urls.map((url, i) => () => fetch(url))
// urls will be fetched in order
serialExec(promiseCalls).then(console.log)
// will add a 0-500ms delay between each call
serialExec(promiseCalls, {
randomTimeout: 500
}).then(console.log)