Registry / testing / puqeue

puqeue

JSON →
library1.1.33jsnpmunverified

A small JavaScript library for queuing promises, allowing control over concurrency and priority. Current stable version: 1.1.33. Simple API with support for options like maxOperationCount and task priority. Less feature-rich than async.queue but lightweight and easy to integrate.

npm install puqeue
INSTALL
IMPORT
SIG · PUQEUE
P
puqeue
testingjavascriptv1.1.33
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.

Puqeue
import Puqeue from 'puqeue'
const Puqeue = require('puqeue')
ESM default import is recommended; CommonJS require also works but may cause issues in ESM contexts.
Puqeue
import { default as Puqeue } from 'puqeue'
import { Puqeue } from 'puqeue'
Named import 'Puqeue' is not exported; use default import.
Puqeue
const Puqeue = require('puqeue')
CommonJS require pattern works directly.

Creates a queue with concurrency 1 and adds three tasks executed sequentially.

import Puqeue from 'puqeue'; const queue = new Puqeue({ maxOperationCount: 1 }); await Promise.all([ queue.add(async () => { console.log('task1'); }), queue.add(async () => { console.log('task2'); }), queue.add(async () => { console.log('task3'); }) ]); console.log('All tasks completed.');
Debug
Known issues
gotchaIf you pass a non-function to queue.add(), it will throw an error.
fix
Ensure the argument to add() is a function returning a promise.
affects: >=1.0
gotchaDefault priority is 10. Giving priority values less than 10 doesn't guarantee earlier execution order; it's relative only between tasks.
fix
Use distinct priority values to control order.
affects: >=1.0
gotchaSetting maxOperationCount to 0 runs all tasks concurrently without limit, which may cause high memory usage.
fix
Set a finite maxOperationCount for resource control.
affects: >=1.0
Errors
Common errors & fixes
TypeError: queue.add is not a function
Import error: using wrong import statement or mismatched module system.
fix
Use correct import: import Puqeue from 'puqeue' or const Puqeue = require('puqeue').
Uncaught TypeError: add is not a function
Puqeue constructor not properly called (e.g., missing new).
fix
Instantiate with 'new Puqeue()'.
Upgrade
Version history
1.1.33latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
packagepuqeue
puqeue — npm install puqeue · libregistry