{"id":18352,"library":"express-queue","title":"express-queue","description":"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.","status":"active","version":"0.0.13","language":"javascript","source_language":"en","source_url":"https://github.com/alykoshin/express-queue","tags":["javascript","express,middleware,mw,queue,limit,delay,simultaneous"],"install":[{"cmd":"npm install express-queue","lang":"bash","label":"npm"},{"cmd":"yarn add express-queue","lang":"bash","label":"yarn"},{"cmd":"pnpm add express-queue","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Internal queue implementation","package":"mini-queue","optional":false}],"imports":[{"note":"ESM default import works; CommonJS require works in Node >=6","wrong":"const queue = require('express-queue')","symbol":"default","correct":"import queue from 'express-queue'"},{"note":"CommonJS pattern: package exports a single function, not a named export","wrong":"const { queue } = require('express-queue')","symbol":"default","correct":"const queue = require('express-queue')"},{"note":"For TypeScript with esModuleInterop false, use this destructuring","wrong":"","symbol":"default","correct":"const { default: queue } = require('express-queue')"}],"quickstart":{"code":"const express = require('express');\nconst queue = require('express-queue');\nconst app = express();\n\napp.use(queue({ activeLimit: 2, queuedLimit: -1 }));\n\napp.get('/', (req, res) => {\n  res.send('Hello World!');\n});\n\napp.listen(3000, () => {\n  console.log('Server running on port 3000');\n});","lang":"javascript","description":"Sets up Express with queue middleware limiting concurrent requests to 2, queueing excess requests without rejection."},"warnings":[{"fix":"Set queuedLimit to -1 for unlimited queue, or a positive integer for limited queue.","message":"Setting queuedLimit to 0 causes all requests to be rejected immediately","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure app.use(queue(...)) is called before any route definitions.","message":"Middleware must be used before routes that need queueing; otherwise requests bypass the queue","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set activeLimit to at least 1 to allow processing.","message":"activeLimit must be > 0; setting to 0 will cause all requests to be queued indefinitely","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use const queue = require('express-queue'); then use queue({...}) as middleware.","cause":"Incorrect import (e.g., destructuring '{ queue }' from require)","error":"Middleware is not a function"},{"fix":"Run 'npm install express-queue' and check package.json for correct spelling.","cause":"Package not installed or misspelled","error":"Cannot find module 'express-queue'"},{"fix":"In Node.js CJS: const queue = require('express-queue'); in ESM: import queue from 'express-queue';","cause":"Using default import incorrectly in ESM or CommonJS","error":"queue is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}