Registry / devops / func-queue

func-queue

JSON →
library1.2.2jsnpmunverified

v1.2.2 — A lightweight Node.js queue library that supports sequential, persistent, and concurrent execution of functions with custom callback error handling. Released in 2012 (last update 2013), it provides createQueue for sequential tasks, createPersistentQueue for re-runnable tasks, and createConcurrentQueue for parallel keyed queues. Unlike modern promise-based queues (e.g., Bull, async.queue), it uses a callback-driven API where each step manually delivers results or errors. Suitable for simple Node.js callback patterns but outdated compared to promise/async alternatives.

npm install func-queue
INSTALL
IMPORT
SIG · FUNC-QUEUE
F
func-queue
devopsjavascriptv1.2.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.

default
const queue = require('func-queue');
import queue from 'func-queue';
This package is CommonJS only; no ESM or TypeScript support.
createQueue
const queue = require('func-queue'); const q = queue.createQueue(errCb, successCb);
const { createQueue } = require('func-queue');
createQueue is a method on the default export, not a named export.
createPersistentQueue
const queue = require('func-queue'); const pq = queue.createPersistentQueue(errCb, successCb);
const pq = require('func-queue').createPersistentQueue;
Must call the returned object's method, not import as a function directly.

Demonstrates creating a sequential queue with error handling and dynamic task appending.

const queue = require('func-queue'); const q = queue.createQueue( (err, code) => console.log('Error:', err, 'Code:', code), () => console.log('Finished') ); q.add((arg1) => { console.log('Step 1, arg1:', arg1); q.deliver(++arg1); }); q.add((arg1) => { console.log('Step 2, arg1:', arg1); q.append((arg1) => { console.log('Step 3, arg1:', arg1); return q.error('last', -1); }); q.deliver(++arg1); }); q.execute(1);
Debug
Known issues
deprecatedPackage is unmaintained since 2013 and uses outdated callback patterns.
fix
Migrate to a modern queue library like async.queue, Bull, or p-queue.
affects: *
gotchaCalling add() or execute() on an already executing Queue throws an Exception.
fix
Only call add() before execute() or use append() during execution.
affects: *
gotchaThe callback_error and callback_successed parameters are positional and optional; omitting callback_successed can cause unexpected behavior.
fix
Always provide both callbacks to avoid fallback to error callback with null parameter.
affects: *
Errors
Common errors & fixes
TypeError: queue.createQueue is not a function
Incorrect import: using ESM import instead of CommonJS require.
fix
Use: const queue = require('func-queue');
Error: Queue is already executing
Calling add() or execute() on a queue that is already running.
fix
Move add() calls before execute() or use append() to add tasks during execution.
Cannot find module 'func-queue'
Package not installed or Node.js version incompatible.
fix
Run: npm install func-queue
Upgrade
Version history
1.2.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

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