Registry / testing / quu
library0.5.0jsnpmunverified

quu is a lightweight concurrent function queue for Node.js (v0.5.0, latest stable). It allows specifying maximum concurrency and optional wait mode before starting tasks. Tasks are added via push() and executed with run(), supporting both callback and promise APIs. Differentiators include minimal configuration, zero dependencies, and simple interface compared to heavier queue libraries like Bull or async.queue.

npm install quu
INSTALL
IMPORT
SIG · QUU
Q
quu
testingjavascriptv0.5.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.

quu
const quu = require('quu');
import quu from 'quu';
Package is CJS-only; ESM import not supported.
default
const quu = require('quu');
const { quu } = require('quu');
Default export is a function, not named.
QuuQueue type
/** @typedef {import('quu')} QuuQueue */
No TypeScript types shipped; use JSDoc or ambient declarations.

Create a queue with concurrency 2, push three tasks (one failing), then run with callback.

const quu = require('quu'); const q = quu(2); // max 2 concurrent tasks q.push(done => { setTimeout(() => { done(); }, 1000); }); q.push(done => { setTimeout(() => { done(new Error('task failed')); }, 500); }); q.push(done => { setTimeout(() => { done(); }, 200); }); q.run((errors, completed) => { console.log('completed:', completed); if (errors) errors.forEach(e => console.error(e.message)); });
Debug
Known issues
gotchaIf wait mode is false (default), tasks start executing immediately upon push() even before run() is called. This can lead to unexpected behavior if tasks depend on external state set after push().
fix
Pass true as second argument: quu(concurrency, true) to defer execution until run() is called.
affects: >=0.0.0
gotchaErrors collected from tasks are passed as an array to run() callback/promise. The array may contain undefined or non-Error values if task calls done() without argument.
fix
Always call done(err) with an Error object or null/undefined. In callback, filter errors: errors.filter(Boolean).forEach(...)
affects: >=0.0.0
gotcharun() can only be called once per batch. Calling run() again after completion will have no effect.
fix
Create a new queue instance for each batch, or push new tasks and call run() again (but only the first call will execute).
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: quu is not a function
Using ES6 import (import quu from 'quu') which is not supported.
fix
Use require('quu') instead.
ReferenceError: done is not defined
Incorrect usage of task function signature; expecting done parameter but code may have omitted it.
fix
Ensure task function receives done callback: q.push(done => { ... done(); });
Task not executed
run() called with wait=false (default) and push() after run()
fix
Push all tasks before calling run(), or use wait mode: const q = quu(5, true);
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
packagequu
quu — npm install quu · libregistry