{"id":45961,"library":"qrate","title":"qrate - Node.js queue with concurrency and rate limiting","description":"qrate is a Node.js queue library (v2.0.1, stable, low maintenance) that extends async.queue with configurable concurrency and rate limiting. It allows controlling the maximum number of workers running at any time and limiting the number of workers started per second. Key differentiators vs async: built-in rate limiting without external timers, and a drop-in replacement API. qrate uses an ESM-only module format, no TypeScript types shipped, and works in Node.js environments. It has no external dependencies.","status":"active","version":"2.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/glynnbird/qrate","tags":["javascript","queue","async","rate","node.js"],"install":[{"cmd":"npm install qrate","lang":"bash","label":"npm"},{"cmd":"yarn add qrate","lang":"bash","label":"yarn"},{"cmd":"pnpm add qrate","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"qrate is ESM-only (since v2). CommonJS require() will fail with ERR_REQUIRE_ESM. Use dynamic import() if needed: const qrate = (await import('qrate')).default.","wrong":"const qrate = require('qrate')","symbol":"default export","correct":"import qrate from 'qrate'"},{"note":"QRateQueue is not exported as a runtime value. Use import type for TypeScript if you only need the type.","wrong":"import { QRateQueue } from 'qrate'","symbol":"type import (TypeScript)","correct":"import type { QRateQueue } from 'qrate'"},{"note":"qrate takes arguments in order: worker, concurrency (optional), rateLimit (optional). Options object is not supported.","wrong":"const q = qrate({worker, concurrency: 1, rateLimit: null})","symbol":"queue creation","correct":"const q = qrate(worker, concurrency, rateLimit)"}],"quickstart":{"code":"import qrate from 'qrate';\n\nconst start = Date.now();\nconst worker = (task, done) => {\n  console.log('Processing', task, '@', Date.now() - start, 'ms');\n  setTimeout(done, 100);\n};\n\n// concurrency 1, rateLimit 2 per second\nconst q = qrate(worker, 1, 2);\n\nfor (let i = 0; i < 6; i++) {\n  q.push({ i });\n}","lang":"javascript","description":"Create a queue with rate limiting (2 jobs/sec) and push 6 items. Worker simulates 100ms async work."},"warnings":[{"fix":"Use import instead of require, or use dynamic import: const qrate = (await import('qrate')).default","message":"qrate v2 is ESM-only and does not support CommonJS require().","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Upgrade to v2 and switch to ESM imports.","message":"qrate v1 used CommonJS and is deprecated. v2 uses ES modules.","severity":"deprecated","affected_versions":"<2.0.0"},{"fix":"Ensure your rateLimit value matches your desired jobs-per-second (not per minute).","message":"rateLimit is per second, not per minute or millisecond. rateLimit=0.5 means one job every 2 seconds.","severity":"gotcha","affected_versions":"*"},{"fix":"Do not rely on pause/resume; manage concurrency externally if needed.","message":"The queue does not support pausing or resuming like async.queue (no q.pause() or q.resume()).","severity":"gotcha","affected_versions":"*"},{"fix":"Install @types/qrate or declare a module: declare module 'qrate';","message":"qrate does not ship TypeScript definitions. You must provide your own or use @types/qrate if available.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'allow':29 'api':67 'async':52,92 'async.queue':21 'built':54 'built-in':53 'concurr':5,24 'configur':23 'control':30 'depend':89 'differenti':50 'drop':64 'drop-in':63 'environ':84 'esm':72 'esm-on':71 'extend':20 'extern':59,88 'format':75 'javascript':90 'key':49 'librari':14 'limit':8,27,41,57 'low':17 'mainten':18 'maximum':32 'modul':74 'node.js':2,12,83,94 'number':33,43 'per':47 'qrate':1,9,68 'queue':3,13,91 'rate':7,26,56,93 'replac':66 'run':36 'second':48 'ship':79 'stabl':16 'start':46 'time':39 'timer':60 'type':78 'typescript':77 'use':69 'v2.0.1':15 'vs':51 'without':58 'work':81 'worker':35,45","created_at":"2026-06-07T12:57:35.030642+00:00","updated_at":"2026-06-07T12:57:35.030642+00:00","problems":[{"fix":"Change to import qrate from 'qrate' or use dynamic import().","cause":"qrate v2 is ESM-only, but code uses require('qrate').","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module ... not supported."},{"fix":"Ensure you are using import qrate from 'qrate' (not { qrate }).","cause":"Possibly using default import incorrectly or CommonJS require on v2 ESM.","error":"TypeError: qrate is not a function"},{"fix":"Use import statement instead.","cause":"Using require('qrate') in an ESM context.","error":"ReferenceError: require is not defined in ES module scope"}],"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/glynnbird/qrate#readme","github":"https://github.com/glynnbird/qrate","docs":null,"changelog":null,"pypi":null,"npm":"qrate","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"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}}