Registry / devops / promiseq

promiseq

JSON →
library1.1.0jsnpmunverified

Promise queue for Node.js that maintains a queue of promises and tracks completion of individual jobs and the entire queue. Inspired by promise-queue but built specifically for Node.js with bluebird providing promises and async.queue for queue operations. Current stable version is 1.1.0, with a low release cadence (1.1.0 released with stat deprecations and additions; 1.0.0 added canAccept() and allowance). Differentiators include integration with bluebird, async.queue backing, and statistics tracking (complete, failed, succeeded).

npm install promiseq
INSTALL
IMPORT
SIG · PROMISEQ
P
promiseq
devopsjavascriptv1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PromiseQueue
✓ const PromiseQueue = require('promiseq')
✗ import PromiseQueue from 'promiseq'
Package is CJS-only. ESM import will not work out-of-the-box.
queue.push
✓ queue.push(job).then(() => {})
✗ await queue.push(job)
push() returns a promise that resolves when the job completes, not when added to the queue. Using await without .then() is fine, but note it's promise-based.
queue.close
✓ queue.close().then(() => {})
✗ queue.close() // without handling promise
close() returns a promise that resolves when the queue is drained. Must be awaited to ensure all jobs finish.

Demonstrates creating a PromiseQueue with 4 workers, adding a single job via push(), and closing the queue to wait for drain.

const PromiseQueue = require('promiseq'); const P = require('bluebird'); const queue = new PromiseQueue(4); const job = () => { return new P((resolve) => { setTimeout(() => { console.log('Job done'); resolve(); }, 100); }); }; queue.push(job).then(() => { console.log('Job complete'); }); queue.close().then(() => { console.log('Queue closed and drained'); });
Debug
Known issues
deprecatedThe `processed` stat is deprecated in favor of `complete`.
fix
Use `complete` instead of `processed` when accessing queue stats.
affects: >=1.1.0
gotchaThe `push()` method returns a promise that resolves when the job completes, not when the job is queued. This is different from many queue libraries.
fix
Use the returned promise to track individual job completion, or ignore it if only overall queue completion matters.
affects: >=0.1.0
gotchaThe package requires bluebird or another promise library to be installed separately. It is not bundled.
fix
Install bluebird: `npm install bluebird`
affects: >=0.1.0
gotchaThe package is CJS-only and does not support ESM natively.
fix
Use require() or use a dynamic import() workaround if needed.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'promiseq'
Package not installed or not found in node_modules.
fix
Run `npm install promiseq` in your project directory.
TypeError: PromiseQueue is not a constructor
Using ES module import incorrectly; PromiseQueue is exported as module.exports.
fix
Use `const PromiseQueue = require('promiseq');` instead of `import PromiseQueue from 'promiseq';`.
ReferenceError: Promise is not defined
No promise library installed. PromiseQueue depends on an external promise implementation.
fix
Install bluebird: `npm install bluebird` and require it before using PromiseQueue.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
bluebirdoptionalPromise implementation used internally; required if using default promise library
Agent activity
4 hits · last 30 days
node
4
Resources
promiseq — npm install promiseq · libregistry