{"id":46862,"library":"zqueue","title":"ZQueue","description":"A lightweight JavaScript library for queueing and running promise-based jobs with concurrency control. Version 0.1.1 is the latest stable release, with no established release cadence. It allows developers to limit the number of concurrent operations, such as controlling upload bandwidth by restricting simultaneous HTTP requests. Compared to alternatives like p-limit or bottleneck, ZQueue offers a minimal API surface focused solely on concurrency limits. It is CommonJS and supports TypeScript via type definitions.","status":"active","version":"0.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/andressrg/zqueue","tags":["javascript"],"install":[{"cmd":"npm install zqueue","lang":"bash","label":"npm"},{"cmd":"yarn add zqueue","lang":"bash","label":"yarn"},{"cmd":"pnpm add zqueue","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM import is recommended; CommonJS require also works but TypeScript may need esModuleInterop.","wrong":"const ZQueue = require('zqueue')","symbol":"ZQueue","correct":"import { ZQueue } from 'zqueue'"},{"note":"Package has both named and default exports; default export is the same function.","wrong":"const { ZQueue } = require('zqueue')","symbol":"ZQueue (default)","correct":"import ZQueue from 'zqueue'"},{"note":"QueueOptions is a TypeScript type, not a runtime value; use 'import type' for correctness.","wrong":"import { QueueOptions } from 'zqueue'","symbol":"QueueOptions","correct":"import type { QueueOptions } from 'zqueue'"}],"quickstart":{"code":"import { ZQueue } from 'zqueue';\nimport axios from 'axios';\n\nconst queue = ZQueue({ max: 3 });\n\nconst upload = (file: Buffer) =>\n  queue.run(() => axios.put('https://example.com/upload', file));\n\nawait Promise.all([file1, file2, file3, file4, file5].map(upload));\nconsole.log('All uploads completed.');","lang":"typescript","description":"Creates a queue with max 3 concurrent jobs and uses it to limit parallel HTTP uploads."},"warnings":[{"fix":"Use ZQueue({ max: ... }) as a function, not new ZQueue().","message":"Constructor must be called without 'new'","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Wrap your job logic with try-catch or implement retry manually inside the callback.","message":"Jobs are not automatically retried on rejection","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Maintain your own external job tracking if you need to inspect queue state.","message":"Queue object is not iterable; you cannot monitor pending jobs directly","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use a more feature-rich library like bottleneck or p-limit if advanced control is needed.","message":"Library does not support priority or pausing","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.1.1':18 'allow':30 'altern':51 'api':62 'bandwidth':43 'base':12 'bottleneck':57 'cadenc':28 'commonj':71 'compar':49 'concurr':15,37,67 'control':16,41 'definit':77 'develop':31 'establish':26 'focus':64 'http':47 'javascript':4,78 'job':13 'latest':21 'librari':5 'lightweight':3 'like':52 'limit':33,55,68 'minim':61 'number':35 'offer':59 'oper':38 'p':54 'p-limit':53 'promis':11 'promise-bas':10 'queue':7 'releas':23,27 'request':48 'restrict':45 'run':9 'simultan':46 'sole':65 'stabl':22 'support':73 'surfac':63 'type':76 'typescript':74 'upload':42 'version':17 'via':75 'zqueue':1,58","created_at":"2026-06-07T13:01:59.958024+00:00","updated_at":"2026-06-07T13:01:59.958024+00:00","problems":[{"fix":"Call ZQueue({ max: 3 }) without 'new'.","cause":"Attempting to use 'new ZQueue()' when ZQueue is a function that returns an object.","error":"TypeError: ZQueue is not a constructor"},{"fix":"Attach a catch handler: queue.run(() => promise).catch(err => console.error(err)).","cause":"A job in the queue rejected but no .catch() was attached to queue.run().","error":"UnhandledPromiseRejectionWarning: Error: ..."},{"fix":"Run 'npm install zqueue' and ensure tsconfig.json includes 'node_modules/@types' or the package ships types.","cause":"Missing zqueue package installation or TypeScript cannot locate type definitions.","error":"Cannot find module 'zqueue' 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/andressrg/zqueue#readme","github":"https://github.com/andressrg/zqueue","docs":null,"changelog":null,"pypi":null,"npm":"zqueue","openapi_spec":null,"status_page":null,"smithery":null,"categories":["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}}