Registry / testing / rygr.async-queue

rygr.async-queue

JSON →
library1.2.0jsnpmunverified

Async queue library for Node.js and browser that assembles asynchronous methods to be run in sequence, inspired by Express middleware. Version 1.2.0 (last release appears to be stable, no recent updates). Differentiator: lightweight, simple API with error handling via extra function parameter. Depends on jQuery (browser) or q (Node) for promise support.

npm install rygr.async-queue
INSTALL
IMPORT
SIG · RYGR.ASYNC-QUEUE
R
rygr.async-queue
testingjavascriptv1.2.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.

asyncQueue
const asyncQueue = require('rygr.async-queue')
import asyncQueue from 'rygr.async-queue'
This library uses CommonJS, not ESM. Use require() for both Node.js and browser (browserify/webpack).
default import
const asyncQueue = require('rygr.async-queue')
import * as asyncQueue from 'rygr.async-queue'
The module exports a single function directly; no named exports.
TypeScript usage
const asyncQueue: (...args: any[]) => void = require('rygr.async-queue')
import asyncQueue from 'rygr.async-queue'
No TypeScript definitions; use require and manual typing.

Demonstrates async queue with argument passing, error propagation, and done callback.

const asyncQueue = require('rygr.async-queue'); const first = (name, next) => { console.log(`${name}: first!`); next(); }; const second = (name, next) => { throw new Error('Uhoh!'); }; const third = (name, next) => { console.log(`${name}: third!`); }; const errorHandler = (error, name, next) => { console.log(error.message); next(error); }; const done = (error) => { console.log(error ? "Something went wrong." : "Success!"); }; asyncQueue(['Test'], [first, second, third, errorHandler], done); // Output: Test: first!\nUhoh!\nSomething went wrong.
Debug
Known issues
gotchaError function signature must have error as first argument; otherwise it will be treated as a normal function.
fix
Ensure error handler functions have signature (error, ...args, next).
affects: >=0.0.0
gotchaIf no error handler is provided, an error will skip to done callback with the error; if done is also missing, error is silently ignored.
fix
Always provide a done callback to handle errors.
affects: >=0.0.0
deprecatedDependency on 'q' and 'jquery' is outdated; modern projects prefer native Promises or async/await.
fix
Consider using async/await or a more modern queue library.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: asyncQueue is not a function
Using ES6 import syntax with a CommonJS module.
fix
Change to const asyncQueue = require('rygr.async-queue').
ReferenceError: next is not defined
Forgetting to pass next function to queue functions or incorrect order of arguments.
fix
Ensure each queue function receives next as last parameter and calls it.
Error: Cannot find module 'q'
Missing required dependency 'q' for Node.js.
fix
Run npm install q or include it in package.json.
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
qrequiredNode build dependency for promise support
jqueryoptionalBrowser build dependency
Agent activity
8 hits · last 30 days
node
8
Resources
rygr.async-queue — npm install rygr.async-queue · libregistry