Registry / devops / runq
library1.1.2jsnpmunverified

A minimal library for running a queue of functions sequentially, passing results through a chain of callbacks. Version 1.1.2 is stable with no recent updates. It provides a simple chainable API for sequential async execution, similar to async.waterfall but with a different calling convention. Lightweight and dependency-free.

npm install runq
INSTALL
IMPORT
SIG · RUNQ
R
runq
devopsjavascriptv1.1.2
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.

runq
const runq = require('runq');
import runq from 'runq';
runq is a CommonJS library; ESM import not supported.
runq (default export)
const runq = require('runq');
const { runq } = require('runq');
runq exports a single function, not an object.
runq() (instance)
const q = runq();
const q = new runq();
runq is a factory function, not a constructor.

Creates a queue, adds two steps to increment and double, runs with initial value 1, and logs the result 4.

const runq = require('runq'); runq() .add(function(cb, a) { cb(null, a + 1); }) .add(function(cb, a) { cb(null, a * 2); }) .run(function(err, result) { if (err) { console.error('Error:', err); } else { console.log('Result:', result); // Result: 4 } }, 1);
Debug
Known issues
gotchaFirst argument of each callback is error; must pass null for success.
fix
Always call cb(null, result) or similar; do not omit error argument.
affects: >=0.0.0
gotchaFunctions receive only one value from previous step; extra arguments are undefined.
fix
If multiple values needed, pass an object or array.
affects: >=0.0.0
gotchaNo error handling in intermediate steps; an error stops the queue.
fix
Check errors in each step; use patterns like if(err) return cb(err);
affects: >=0.0.0
gotchaCannot add steps after calling run(); run() must be last.
fix
Chain all .add() calls before .run().
affects: >=0.0.0
gotchaThe initial value passed to run() is the first argument in the first function.
fix
Pass the starting value as second argument to .run() (first argument is final callback).
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: runq is not a function
Using import instead of require with CommonJS module.
fix
Use require('runq') instead of import.
TypeError: q.run is not a function
Calling runq() as a constructor with 'new' or missing parentheses.
fix
Use const q = runq(); (no new).
Callback called multiple times
Calling cb more than once in a function.
fix
Ensure each function only calls cb exactly once.
Upgrade
Version history
1.1.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
packagerunq
runq — npm install runq · libregistry