{"id":46582,"library":"tasque","title":"tasque","description":"A simple TypeScript task queue with parallel execution control, queue capacity limits, position listeners, and async iteration. Stable version 0.1.2, ships TypeScript types, published on npm and JSR. Key differentiators: very low bundle size (<1KB minzip), supports dynamic parallelism scaling, capacity limits, and both positional listeners and async iterable streams for task progress. Peer dependency on TypeScript ^5.0 indicates type-aware usage.","status":"active","version":"0.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/sv2dev/tasque","tags":["javascript","typescript"],"install":[{"cmd":"npm install tasque","lang":"bash","label":"npm"},{"cmd":"yarn add tasque","lang":"bash","label":"yarn"},{"cmd":"pnpm add tasque","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Named export, not default.","wrong":"import createQueue from 'tasque'","symbol":"createQueue","correct":"import { createQueue } from 'tasque'"},{"note":"Type import for TypeScript; Queue is not a value.","wrong":"import { Queue } from 'tasque'","symbol":"Queue","correct":"import { type Queue } from 'tasque'"},{"note":"Type import for options object.","symbol":"AddOptions","correct":"import { type AddOptions } from 'tasque'"}],"quickstart":{"code":"import { createQueue } from 'tasque';\n\nconst queue = createQueue({ parallelize: 2, max: 10 });\n\nqueue.add(async () => {\n  await new Promise(resolve => setTimeout(resolve, 1000));\n  return 'done';\n});\n\nqueue.add(() => 'sync done', (pos) => {\n  console.log('Position:', pos);\n});\n\nconst iterable = queue.iterate(async () => 'streamed');\nif (iterable) {\n  for await (const [pos, value] of iterable) {\n    console.log(pos, value);\n  }\n}","lang":"typescript","description":"Demonstrates queue creation with parallelism and capacity, adding async and sync tasks with a position listener, and using the async iterable stream."},"warnings":[{"fix":"Always check the return value of `add` for null before awaiting.","message":"Adding more tasks than `max` returns `null` instead of a Promise","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Always set `parallelize` to a positive integer (>=1).","message":"Setting `parallelize` to 0 or negative might cause unexpected behavior","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Set `max` to a finite number to use `iterate`.","message":"`iterate` returns `null` if queue capacity is unlimited (max is undefined or Infinity)","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Consider this when designing behaviour; running tasks must complete or be aborted externally.","message":"Changing `parallelize` down does not stop running tasks; only queued tasks wait","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.1.2':21 '1kb':36 '5.0':59 'async':17,49 'awar':63 'bundl':34 'capac':12,42 'control':10 'depend':56 'differenti':31 'dynam':39 'execut':9 'indic':60 'iter':18,50 'javascript':65 'jsr':29 'key':30 'limit':13,43 'listen':15,47 'low':33 'minzip':37 'npm':27 'parallel':8,40 'peer':55 'posit':14,46 'progress':54 'publish':25 'queue':6,11 'scale':41 'ship':22 'simpl':3 'size':35 'stabl':19 'stream':51 'support':38 'task':5,53 'tasqu':1 'type':24,62 'type-awar':61 'typescript':4,23,58,66 'usag':64 'version':20","created_at":"2026-06-07T13:00:38.193177+00:00","updated_at":"2026-06-07T13:00:38.193177+00:00","problems":[{"fix":"Create queue with `max` option: `createQueue({ max: 10 })`","cause":"Attempting to call `iterate` on a queue with no `max` set","error":"TypeError: queue.iterate is not a function"},{"fix":"Update to version 0.1.x: `npm install tasque@latest`","cause":"Using older version before parallelize was added (v0.1.0?)","error":"Property 'parallelize' does not exist on type 'Queue'"}],"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/sv2dev/tasque#readme","github":"https://github.com/sv2dev/tasque","docs":null,"changelog":null,"pypi":null,"npm":"tasque","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}}