Registry / devops / noqueue

noqueue

JSON →
library5.0.15jsnpmunverified

noqueue is an asynchronous queue and loop utility library for Node.js (v5.0.15, last updated in 2021). It provides an infinity loop with built-in queue management, parallel execution, and utility functions like First (race), Fill (allSettled), TillSuccess (retry), and AwaitSleep. Written in TypeScript with ESM support. Differentiates from simple setTimeout/setInterval by offering structured event-driven patterns with failover and synchronous/asynchronous job control. Suitable for task scheduling, retries, and concurrent processing.

npm install noqueue
INSTALL
IMPORT
SIG · NOQUEUE
N
noqueue
devopsjavascriptv5.0.15
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.

QueueLoop
import { QueueLoop } from 'noqueue'
import { QueueLoop } from 'noqueue/QueueLoop'
Default export is not available; named import from package root.
ParallelLoop
import { ParallelLoop } from 'noqueue'
const ParallelLoop = require('noqueue').ParallelLoop
Works with CJS require, but ESM import is recommended for TypeScript.
First
import { First } from 'noqueue'
import First from 'noqueue'
First is a named utility function, not default export.
Fill
import { Fill } from 'noqueue'
import { Fill } from 'noqueue/Utilities'
All exports are from the main package, no subpaths.
TillSuccess
import { TillSuccess } from 'noqueue'
Named export; ensures a job retries until success.

Demonstrates basic queue loop usage with AwaitSleep and retry with TillSuccess.

import { QueueLoop, AwaitSleep, TillSuccess } from 'noqueue'; const queue = new QueueLoop(); queue.enqueue(async () => { console.log('Job 1'); await AwaitSleep(100); }); queue.enqueue(async () => { console.log('Job 2'); await AwaitSleep(100); }); // Start processing queue.start(); // Stop after 1 second setTimeout(() => queue.stop(), 1000); // Retry a job till success const fetchData = async () => { const resp = await fetch('https://api.example.com/data', { signal: AbortSignal.timeout(2000) }); if (!resp.ok) throw new Error('Retry'); return resp.json(); }; const result = await TillSuccess(fetchData, { delay: 500, maxRetry: 5 }); console.log('Fetched:', result);
Debug
Known issues
breakingv5 removed CommonJS support? Check documentation; README indicates ESM focus but CJS require works.
fix
Use import syntax or ensure Node version supports ESM; if using CJS, test with require('noqueue').
affects: >=5.0.0
gotchaQueueLoop.start() does not return a promise; jobs are processed asynchronously.
fix
Use events or callbacks to know when queue is empty.
affects: *
gotchaTillSuccess uses exponential backoff? Default delay behavior is not documented; test with custom delay.
fix
Provide explicit delay and maxRetry options to control retry behavior.
affects: *
gotchaFirst utility may leave pending promises if some jobs never resolve; no cancellation support.
fix
Ensure all passed promises settle or use AbortController/timeout.
affects: *
deprecatedAwaitSleep is just a promise-based setTimeout; no special behavior.
fix
Use new Promise(resolve => setTimeout(resolve, ms)) directly if preferred.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'noqueue'
Package not installed or import path incorrect.
fix
Run `npm install noqueue` and ensure import path is 'noqueue' (not 'noqueue/src').
TypeError: queue.enqueue is not a function
Importing wrong symbol or using default export incorrectly.
fix
Use named import: `import { QueueLoop } from 'noqueue'` and instantiate with `new QueueLoop()`.
SyntaxError: Cannot use import statement outside a module
ESM syntax in a CJS environment or missing 'type':'module' in package.json.
fix
Add 'type':'module' to package.json or use require: `const { QueueLoop } = require('noqueue')`.
Upgrade
Version history
5.0.15latest on npm
Audit
Dependencies

No dependency data recorded yet.

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