{"id":45849,"library":"promiseq","title":"PromiseQ","description":"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).","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/snailjs/promiseq","tags":["javascript","promise","queue","q","bluebird","async","migration"],"install":[{"cmd":"npm install promiseq","lang":"bash","label":"npm"},{"cmd":"yarn add promiseq","lang":"bash","label":"yarn"},{"cmd":"pnpm add promiseq","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Promise implementation used internally; required if using default promise library","package":"bluebird","optional":true}],"imports":[{"note":"Package is CJS-only. ESM import will not work out-of-the-box.","wrong":"import PromiseQueue from 'promiseq'","symbol":"PromiseQueue","correct":"const PromiseQueue = require('promiseq')"},{"note":"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.","wrong":"await queue.push(job)","symbol":"queue.push","correct":"queue.push(job).then(() => {})"},{"note":"close() returns a promise that resolves when the queue is drained. Must be awaited to ensure all jobs finish.","wrong":"queue.close() // without handling promise","symbol":"queue.close","correct":"queue.close().then(() => {})"}],"quickstart":{"code":"const PromiseQueue = require('promiseq');\nconst P = require('bluebird');\n\nconst queue = new PromiseQueue(4);\n\nconst job = () => {\n  return new P((resolve) => {\n    setTimeout(() => {\n      console.log('Job done');\n      resolve();\n    }, 100);\n  });\n};\n\nqueue.push(job).then(() => {\n  console.log('Job complete');\n});\n\nqueue.close().then(() => {\n  console.log('Queue closed and drained');\n});","lang":"javascript","description":"Demonstrates creating a PromiseQueue with 4 workers, adding a single job via push(), and closing the queue to wait for drain."},"warnings":[{"fix":"Use `complete` instead of `processed` when accessing queue stats.","message":"The `processed` stat is deprecated in favor of `complete`.","severity":"deprecated","affected_versions":">=1.1.0"},{"fix":"Use the returned promise to track individual job completion, or ignore it if only overall queue completion matters.","message":"The `push()` method returns a promise that resolves when the job completes, not when the job is queued. This is different from many queue libraries.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Install bluebird: `npm install bluebird`","message":"The package requires bluebird or another promise library to be installed separately. It is not bundled.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use require() or use a dynamic import() workaround if needed.","message":"The package is CJS-only and does not support ESM natively.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'1.0.0':58 '1.1.0':45,51 'ad':59 'addit':57 'allow':62 'async':81 'async.queue':37,68 'back':69 'bluebird':33,67,80 'built':28 'cadenc':50 'canaccept':60 'complet':14,73 'current':41 'deprec':55 'differenti':63 'entir':20 'fail':74 'includ':64 'individu':16 'inspir':22 'integr':65 'javascript':76 'job':17 'low':48 'maintain':7 'migrat':82 'node.js':5,31 'oper':40 'promis':2,11,25,35,77 'promise-queu':24 'promiseq':1 'provid':34 'q':79 'queue':3,9,21,26,39,78 'releas':49,52 'specif':29 'stabl':42 'stat':54 'statist':71 'succeed':75 'track':13,72 'version':43","created_at":"2026-06-07T12:57:02.014820+00:00","updated_at":"2026-06-07T12:57:02.014820+00:00","problems":[{"fix":"Run `npm install promiseq` in your project directory.","cause":"Package not installed or not found in node_modules.","error":"Error: Cannot find module 'promiseq'"},{"fix":"Use `const PromiseQueue = require('promiseq');` instead of `import PromiseQueue from 'promiseq';`.","cause":"Using ES module import incorrectly; PromiseQueue is exported as module.exports.","error":"TypeError: PromiseQueue is not a constructor"},{"fix":"Install bluebird: `npm install bluebird` and require it before using PromiseQueue.","cause":"No promise library installed. PromiseQueue depends on an external promise implementation.","error":"ReferenceError: Promise is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://www.nullivex.com/","github":"https://github.com/snailjs/promiseq","docs":null,"changelog":null,"pypi":null,"npm":"promiseq","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}