{"id":45299,"library":"limited-request-queue","title":"Limited Request Queue","description":"A Node.js queue library for interactively managing concurrency and rate limiting of outbound HTTP requests. Version 5.1.0 stable, with a maintenance-focused release cadence. Key differentiators: per-host concurrency limiting via URL host grouping, pause/resume at any time, simple EventEmitter-based API, and options to ignore ports, protocols, and subdomains for host grouping. Unlike generic async queues, it is specifically designed for outbound requests with host-aware throttling.","status":"active","version":"5.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/stevenvachon/limited-request-queue","tags":["javascript","background","concurrency","DoS","http","limiting","queue","rate","request"],"install":[{"cmd":"npm install limited-request-queue","lang":"bash","label":"npm"},{"cmd":"yarn add limited-request-queue","lang":"bash","label":"yarn"},{"cmd":"pnpm add limited-request-queue","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"RequestQueue is the default export, not a named export. Named exports include END_EVENT and ITEM_EVENT constants.","wrong":"import { RequestQueue } from 'limited-request-queue'","symbol":"RequestQueue","correct":"import RequestQueue, { END_EVENT, ITEM_EVENT } from 'limited-request-queue'"},{"note":"END_EVENT is a named export from the package. It is a constant string used for the event name.","wrong":"import { END_EVENT } from 'limited-request-queue' (correct) but confusion arises with default import","symbol":"END_EVENT","correct":"import { END_EVENT } from 'limited-request-queue'"},{"note":"In CommonJS, destructure from the default export: const { default: RequestQueue, END_EVENT, ITEM_EVENT } = require('limited-request-queue')","wrong":"const ITEM_EVENT = require('limited-request-queue').ITEM_EVENT","symbol":"ITEM_EVENT","correct":"import { ITEM_EVENT } from 'limited-request-queue'"},{"note":"Because the package uses ESM source, the CommonJS wrapper exports the default under a 'default' key. Direct require gives an object with a default property.","wrong":"const RequestQueue = require('limited-request-queue')","symbol":"RequestQueue (CommonJS)","correct":"const { default: RequestQueue, END_EVENT, ITEM_EVENT } = require('limited-request-queue')"}],"quickstart":{"code":"import RequestQueue, { ITEM_EVENT, END_EVENT } from 'limited-request-queue';\n\nconst queue = new RequestQueue({ maxSockets: 5 })\n  .on(ITEM_EVENT, (url, data, done) => {\n    console.log(`Fetching: ${url.href}`);\n    fetch(url.href)\n      .then(response => response.text())\n      .then(() => done())\n      .catch(err => done(err));\n  })\n  .on(END_EVENT, () => console.log('All done!'));\n\n['https://example.com', 'https://example.org', 'https://example.net']\n  .forEach(url => queue.enqueue(new URL(url)));","lang":"javascript","description":"Creates a queue with max 5 concurrent requests, enqueues three URLs, logs each fetch and completion."},"warnings":[{"fix":"Use `new URL('http://example.com')` when calling `queue.enqueue()`.","message":"The enqueue method expects a URL object, not a string. Passing a string will throw.","severity":"gotcha","affected_versions":">=5.0.0"},{"fix":"Do not use ignoreSubdomains in browser environments; set to false.","message":"The ignoreSubdomains option is not available in browser builds due to file size.","severity":"gotcha","affected_versions":">=5.0.0"},{"fix":"Use `const { default: RequestQueue } = require('limited-request-queue')` or switch to ESM import.","message":"Version 5 changed from CommonJS to ESM-only source. The require() syntax now requires destructuring from the default export.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Use `ignoreSubdomains: false` and adjust host grouping logic.","message":"The 'ignorePorts' option is deprecated in favor of using the 'ignoreSubdomains' pattern.","severity":"deprecated","affected_versions":">=5.0.0"}],"env_vars":null,"search_vec":"'5.1.0':20 'api':48 'async':62 'awar':74 'background':77 'base':47 'cadenc':28 'concurr':11,34,78 'design':67 'differenti':30 'dos':79 'eventemitt':46 'eventemitter-bas':45 'focus':26 'generic':61 'group':39,59 'host':33,38,58,73 'host-awar':72 'http':17,80 'ignor':52 'interact':9 'javascript':76 'key':29 'librari':7 'limit':1,14,35,81 'mainten':25 'maintenance-focus':24 'manag':10 'node.js':5 'option':50 'outbound':16,69 'pause/resume':40 'per':32 'per-host':31 'port':53 'protocol':54 'queue':3,6,63,82 'rate':13,83 'releas':27 'request':2,18,70,84 'simpl':44 'specif':66 'stabl':21 'subdomain':56 'throttl':75 'time':43 'unlik':60 'url':37 'version':19 'via':36","created_at":"2026-06-07T12:54:19.912732+00:00","updated_at":"2026-06-07T12:54:19.912732+00:00","problems":[{"fix":"Use import or correct CommonJS destructuring: import RequestQueue from 'limited-request-queue'","cause":"Importing the module incorrectly (e.g., trying to use require on ESM).","error":"TypeError: queue.enqueue is not a function"},{"fix":"Use `new URL(string)` when calling enqueue.","cause":"Passing a string to enqueue instead of a URL object.","error":"TypeError: url must be a URL instance"},{"fix":"Ensure consistent module system usage. For CJS: const { default: RequestQueue } = require(...)","cause":"Mixing ESM and CJS incorrectly (e.g., importing default export with destructuring).","error":"Cannot destructure property 'default' of ... as it is undefined."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/stevenvachon/limited-request-queue#readme","github":"https://github.com/stevenvachon/limited-request-queue","docs":null,"changelog":null,"pypi":null,"npm":"limited-request-queue","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}