Registry / testing / avenue

avenue

JSON →
library0.1.6jsnpmunverified

Avenue is a lightweight async/await event queue for Node.js, version 0.1.6. It provides a simple API for managing asynchronous event streams with backpressure support. Released infrequently, it is designed for scenarios where you need to process events in order with concurrency control. Compared to alternatives like `async.queue` or `p-queue`, Avenue focuses on simplicity and native async/await integration, but lacks extensive features and has not been updated in several years.

npm install avenue
INSTALL
IMPORT
SIG · AVENUE
A
avenue
testingjavascriptv0.1.6
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.

Queue
import { Queue } from 'avenue'
const Queue = require('avenue').Queue
ESM named import; CJS destructured require also works but ESM is recommended.
default export (Queue)
const Queue = require('avenue')
import Queue from 'avenue'
The package does not have a default export in ESM; use named import or CJS require.
type Queue
import type { Queue } from 'avenue'
TypeScript users should use the type import for type-only usage.

Shows creating a queue with concurrency 1, adding two async tasks, and waiting for the queue to drain.

import { Queue } from 'avenue'; const queue = new Queue({ concurrency: 1 }); async function main() { queue.push(async () => { console.log('Task 1'); await sleep(100); }); queue.push(async () => { console.log('Task 2'); await sleep(100); }); await queue.drain(); console.log('All done'); } function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } main().catch(console.error);
Debug
Known issues
gotchaQueue constructor requires `new` keyword; omitting it throws a ReferenceError.
fix
Always use `new Queue(options)`.
affects: >=0.1.0
gotchaThe `concurrency` option defaults to 1, not unlimited. If you want unlimited concurrency, set `concurrency: Infinity`.
fix
Explicitly set `concurrency: Infinity` for unlimited concurrency.
affects: >=0.1.0
gotchaCalling `push` after `drain` has resolved will cause the promise to never settle.
fix
Do not call `push` after `drain`; or create a new Queue.
affects: >=0.1.0
deprecatedThe package has not been updated since 2017; consider using more actively maintained alternatives like `p-queue` or `async.queue`.
fix
Migrate to `p-queue` (ESM) or `async` (CJS).
affects: >=0.1.0
Errors
Common errors & fixes
ReferenceError: Queue is not defined
Forgot to import Queue or used wrong import style.
fix
Use `import { Queue } from 'avenue'` or `const Queue = require('avenue').Queue`.
TypeError: queue.push is not a function
Queue not instantiated with `new`.
fix
Instantiate with `new Queue()`.
Error: Cannot find module 'avenue'
Package not installed or wrong import path.
fix
Run `npm install avenue`.
Upgrade
Version history
0.1.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
22
OpenAI (training)
1
Resources
packageavenue
avenue — npm install avenue · libregistry