{"id":45991,"library":"queue-ts","title":"queue-ts","description":"A lightweight, promise-based worker queue for TypeScript and JavaScript that limits concurrent task execution. Current stable version is 0.1.0. It offers a simple API for enqueuing async tasks with a configurable concurrency limit, making it suitable for throttling API calls or managing resource-intensive operations. Differentiator: minimal overhead with no external dependencies, designed specifically for TypeScript projects.","status":"active","version":"0.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/knisterpeter/queue-ts","tags":["javascript"],"install":[{"cmd":"npm install queue-ts","lang":"bash","label":"npm"},{"cmd":"yarn add queue-ts","lang":"bash","label":"yarn"},{"cmd":"pnpm add queue-ts","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only module. Named export.","wrong":"const Queue = require('queue-ts')","symbol":"Queue","correct":"import { Queue } from 'queue-ts'"},{"note":"Default export is also available, but named is recommended.","wrong":"const { default: Queue } = require('queue-ts')","symbol":"Queue (default)","correct":"import Queue from 'queue-ts'"},{"note":"Use type import for TypeScript to avoid bundling the class.","wrong":"import { Queue } from 'queue-ts' // when only type needed","symbol":"Queue (type)","correct":"import type { Queue } from 'queue-ts'"}],"quickstart":{"code":"import { Queue } from 'queue-ts';\n\nconst queue = new Queue(2); // Limit concurrency to 2\nconst task = () => new Promise(resolve => setTimeout(resolve, 1000));\nqueue.enqueue(task);\nqueue.enqueue(task);\nqueue.enqueue(task);\nawait queue.onEmpty(); // Resolves when all tasks complete","lang":"typescript","description":"Creates a queue with concurrency 2, enqueues three tasks, and waits for all to finish."},"warnings":[{"fix":"Implement retry logic within the task function.","message":"Tasks are not automatically retried on failure; the promise will reject and the queue continues.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"If strict FIFO is needed, ensure concurrency is 1.","message":"The queue does not enforce an order of execution beyond first-in-first-out when concurrency allows.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use new Queue(concurrency) or new Queue({ concurrency })","message":"The 'max' option in constructor is deprecated; use 'concurrency' instead.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Enqueue all tasks before calling onEmpty().","message":"Calling onEmpty() before enqueuing tasks may resolve immediately.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.1.0':24 'api':29,44 'async':32 'base':8 'call':45 'concurr':17,37 'configur':36 'current':20 'depend':58 'design':59 'differenti':52 'enqueu':31 'execut':19 'extern':57 'intens':50 'javascript':14,64 'lightweight':5 'limit':16,38 'make':39 'manag':47 'minim':53 'offer':26 'oper':51 'overhead':54 'project':63 'promis':7 'promise-bas':6 'queue':2,10 'queue-t':1 'resourc':49 'resource-intens':48 'simpl':28 'specif':60 'stabl':21 'suitabl':41 'task':18,33 'throttl':43 'ts':3 'typescript':12,62 'version':22 'worker':9","created_at":"2026-06-07T12:57:44.831293+00:00","updated_at":"2026-06-07T12:57:44.831293+00:00","problems":[{"fix":"Use import { Queue } from 'queue-ts' (ESM).","cause":"Using CommonJS require instead of ESM import, or missing default export import.","error":"TypeError: Class extends value undefined is not a constructor or null"},{"fix":"Upgrade to queue-ts@0.1.0 and ensure TypeScript 3.8+.","cause":"Using an older version or TypeScript types not updated.","error":"Property 'onEmpty' does not exist on type 'Queue<unknown>'"},{"fix":"npm install queue-ts and ensure 'moduleResolution' is 'node' in tsconfig.json.","cause":"Package not installed or missing tsconfig settings.","error":"Cannot find module 'queue-ts' or its corresponding type declarations."}],"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/knisterpeter/queue-ts#readme","github":"https://github.com/knisterpeter/queue-ts","docs":null,"changelog":null,"pypi":null,"npm":"queue-ts","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}}