Registry / web-framework / express-queue

express-queue

JSON →
library0.0.13jsnpmunverified

Express middleware that limits the number of simultaneously processed requests by queuing excess requests. Version 0.0.13, stable but low activity. Supports configurable active limit and queued limit with optional custom rejection handler. Uses MiniQueue internally. Differentiates from simple rate-limiters by queuing rather than dropping requests immediately.

npm install express-queue
INSTALL
IMPORT
SIG · EXPRESS-QUEUE
E
express-queue
web-frameworkjavascriptv0.0.13
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import queue from 'express-queue'
const queue = require('express-queue')
ESM default import works; CommonJS require works in Node >=6
default
const queue = require('express-queue')
const { queue } = require('express-queue')
CommonJS pattern: package exports a single function, not a named export
default
const { default: queue } = require('express-queue')
For TypeScript with esModuleInterop false, use this destructuring

Sets up Express with queue middleware limiting concurrent requests to 2, queueing excess requests without rejection.

const express = require('express'); const queue = require('express-queue'); const app = express(); app.use(queue({ activeLimit: 2, queuedLimit: -1 })); app.get('/', (req, res) => { res.send('Hello World!'); }); app.listen(3000, () => { console.log('Server running on port 3000'); });
Debug
Known issues
gotchaSetting queuedLimit to 0 causes all requests to be rejected immediately
fix
Set queuedLimit to -1 for unlimited queue, or a positive integer for limited queue.
affects: >=0.0.0
gotchaMiddleware must be used before routes that need queueing; otherwise requests bypass the queue
fix
Ensure app.use(queue(...)) is called before any route definitions.
affects: >=0.0.0
gotchaactiveLimit must be > 0; setting to 0 will cause all requests to be queued indefinitely
fix
Set activeLimit to at least 1 to allow processing.
affects: >=0.0.0
Errors
Common errors & fixes
Middleware is not a function
Incorrect import (e.g., destructuring '{ queue }' from require)
fix
Use const queue = require('express-queue'); then use queue({...}) as middleware.
Cannot find module 'express-queue'
Package not installed or misspelled
fix
Run 'npm install express-queue' and check package.json for correct spelling.
queue is not a function
Using default import incorrectly in ESM or CommonJS
fix
In Node.js CJS: const queue = require('express-queue'); in ESM: import queue from 'express-queue';
Upgrade
Version history
0.0.13latest on npm
Audit
Dependencies
mini-queuerequiredInternal queue implementation
Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
express-queue — npm install express-queue · libregistry