package
wrapper around async.queue to make some common usages simpler
npm install async-promise-queueGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
A wrapper around the async module, that provides an improved promise queue.
Some highlights:
npm install async-promise-queueor
yarn add async-promise-queueDEBUG="async-promise-queue*" node <your program>And you will be informed when a queue is used, and what its concurrency becomes (note: we can always add more logging, submit your ideas as pull requests!)
'use strict';
const queue = require('async-promise-queue');
queue.async // a reference to the `async` module which `async-promise-queue` is requiring.
// the example worker
const worker = queue.async.asyncify(function(work) {
console.log('work', work.file);
return new Promise(resolve => {
if (work.file === '/path-2') { throw new Error('/path-2'); }
if (work.file === '/path-3') { throw new Error('/path-3'); }
setTimeout(resolve, work.duration);