{"id":46282,"library":"rp-queue","title":"rp-queue","description":"A lightweight promise queue for Node.js (v4+) that runs tasks with concurrency control, rate limiting, and priority support. Version 1.1.0 is the current stable release; updates are infrequent. Key differentiators include support for both simple task arrays and object-style configurations with custom process functions, as well as FIFO and priority queue modes. Unlike larger libraries like Bull or Bee-Queue, rp-queue is minimal and has no dependencies.","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/bplok20010/rp-queue","tags":["javascript","promise","queue","enqueue","limit","limited","rate","batch","ratelimit"],"install":[{"cmd":"npm install rp-queue","lang":"bash","label":"npm"},{"cmd":"yarn add rp-queue","lang":"bash","label":"yarn"},{"cmd":"pnpm add rp-queue","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export only; named import fails.","wrong":"const { RPQueue } = require('rp-queue')","symbol":"RPQueue","correct":"import RPQueue from 'rp-queue'"},{"note":"Package does not support ESM; use require.","wrong":"const { RPQueue } = require('rp-queue')","symbol":"default import (CommonJS)","correct":"const RPQueue = require('rp-queue')"},{"note":"No type definitions shipped; use @types or any.","wrong":"import { RPQueue } from 'rp-queue'","symbol":"type import (TypeScript)","correct":"import RPQueue from 'rp-queue'"}],"quickstart":{"code":"const RPQueue = require('rp-queue');\n\nconst tasks = [\n  () => fetch('https://api.example.com/1'),\n  () => fetch('https://api.example.com/2'),\n  () => fetch('https://api.example.com/3'),\n  () => fetch('https://api.example.com/4'),\n  () => fetch('https://api.example.com/5')\n];\n\n// Run at most 2 concurrent tasks\nRPQueue(tasks, 2).then(() => {\n  console.log('All tasks done');\n});\n\n// With custom process function\nconst items = [1, 2, 3, 4, 5];\nRPQueue(items, {\n  limit: 2,\n  process: (item) => Promise.resolve(item * 2)\n}).then(results => {\n  console.log(results); // [2, 4, 6, 8, 10]\n});","lang":"javascript","description":"Basic concurrency control and custom process function usage."},"warnings":[{"fix":"Ensure every task function returns a Promise.","message":"Tasks must return promises; non-promise returns may cause unexpected behavior.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Specify a limit > 1 for concurrency.","message":"The limit option defaults to 1 if not provided; omitting it runs tasks sequentially.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use priority or separate ordering mechanism if needed.","message":"When using process option, results are in insertion order, not completion order.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.1.0':23 'array':40 'batch':83 'bee':65 'bee-queu':64 'bull':62 'concurr':15 'configur':45 'control':16 'current':26 'custom':47 'depend':75 'differenti':33 'enqueu':79 'fifo':53 'function':49 'includ':34 'infrequ':31 'javascript':76 'key':32 'larger':59 'librari':60 'lightweight':5 'like':61 'limit':18,80,81 'minim':71 'mode':57 'node.js':9 'object':43 'object-styl':42 'prioriti':20,55 'process':48 'promis':6,77 'queue':3,7,56,66,69,78 'rate':17,82 'ratelimit':84 'releas':28 'rp':2,68 'rp-queue':1,67 'run':12 'simpl':38 'stabl':27 'style':44 'support':21,35 'task':13,39 'unlik':58 'updat':29 'v4':10 'version':22 'well':51","created_at":"2026-06-07T12:59:09.952663+00:00","updated_at":"2026-06-07T12:59:09.952663+00:00","problems":[{"fix":"Use 'const RPQueue = require('rp-queue')' or 'import RPQueue from 'rp-queue'.","cause":"Named import instead of default import in CommonJS or ESM.","error":"TypeError: RPQueue is not a constructor"},{"fix":"Install 'node-fetch' or use 'axios' in Node < 18.","cause":"Using fetch in Node.js without a polyfill.","error":"UnhandledPromiseRejectionWarning: ReferenceError: fetch is not defined"},{"fix":"Ensure tasks is an array or iterable of functions/items.","cause":"Passing a non-array or non-iterable as tasks.","error":"TypeError: tasks is not iterable"}],"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/bplok20010/rp-queue#readme","github":"https://github.com/bplok20010/rp-queue","docs":null,"changelog":null,"pypi":null,"npm":"rp-queue","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}}