Registry / testing / queue-cb

queue-cb

JSON →
library1.6.6jsnpmunverified

A lightweight, scalable queue for managing parallel callbacks in Node.js, similar to d3-queue but without accumulating results in memory. The current stable version is 1.6.6, released with a focus on minimal overhead and support for callback-based concurrency. It ships TypeScript definitions and works with Node >=0.8. A key differentiator is its lack of result accumulation, making it suitable for fire-and-forget parallel tasks where you only need to know when all tasks complete or receive an error.

npm install queue-cb
INSTALL
IMPORT
SIG · QUEUE-CB
Q
queue-cb
testingjavascriptv1.6.6
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.

Queue
import { Queue } from 'queue-cb'
const Queue = require('queue-cb');
ESM import works since TypeScript types are provided, but the package is still CommonJS internally; default export style may also work with older bundlers.
default import
import Queue from 'queue-cb'
Some bundlers may allow default import; for consistency, prefer named import.
require (CJS)
const Queue = require('queue-cb');
CommonJS require is supported; the default export is the Queue constructor.

Creates a queue, defers two async tasks, and waits for all to complete without accumulating results.

import { Queue } from 'queue-cb'; function delayedHello(callback) { setTimeout(() => { console.log('Hello!'); callback(null); }, 250); } const q = new Queue(); q.defer(delayedHello); q.defer(delayedHello); q.await((error) => { if (error) throw error; console.log('Goodbye!'); });
Debug
Known issues
gotchaThe queue does not accumulate results; if you need to collect return values, use a different library like d3-queue or async.queue.
fix
Manually accumulate results inside callbacks or use a library with result accumulation.
affects: >=1.0
gotchaThe 'await' method only provides the first error; if multiple tasks error, only the first one is passed.
fix
Wrap each task's callback to collect all errors if needed.
affects: >=1.0
Errors
Common errors & fixes
TypeError: queue_cb_1.Queue is not a constructor
Incorrect import style or ESM/CJS mismatch.
fix
Use `import { Queue } from 'queue-cb'` for ESM or `const Queue = require('queue-cb')` for CommonJS.
Upgrade
Version history
1.6.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
queue-cb — npm install queue-cb · libregistry