{"id":45772,"library":"pico-queue","title":"pico-queue","description":"At only 156 bytes gzipped, pico-queue is a dead-simple, TypeScript-native asynchronous function queue for Node.js and browser. Version 1.2.2 is the current stable release, maintained at a low cadence. It serializes execution of async/sync functions, supports chaining results between tasks, and provides typed generics for safe chaining. Unlike heavier libraries like async/queue or p-limit, pico-queue is minimal but lacks concurrency control or priority.","status":"active","version":"1.2.2","language":"javascript","source_language":"en","source_url":"https://github.com/yuhsak/pico-queue","tags":["javascript","typescript"],"install":[{"cmd":"npm install pico-queue","lang":"bash","label":"npm"},{"cmd":"yarn add pico-queue","lang":"bash","label":"yarn"},{"cmd":"pnpm add pico-queue","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; TypeScript types included. No default export.","wrong":"const createAsyncQueue = require('pico-queue')","symbol":"createAsyncQueue","correct":"import { createAsyncQueue } from 'pico-queue'"},{"note":"Type import only. AsyncQueue is not a runtime export.","wrong":"import { AsyncQueue } from 'pico-queue'","symbol":"AsyncQueue","correct":"import type { AsyncQueue } from 'pico-queue'"},{"note":"CommonJS via require is supported in Node, but default import pattern does not exist.","wrong":"const createAsyncQueue = require('pico-queue').default","symbol":"createAsyncQueue (CommonJS)","correct":"const { createAsyncQueue } = require('pico-queue')"}],"quickstart":{"code":"import { createAsyncQueue } from 'pico-queue'\n\nconst queue = createAsyncQueue()\n\n// Queue async functions sequentially\nqueue.push(async () => {\n  console.log('first')\n})\nqueue.push(async () => {\n  await new Promise(r => setTimeout(r, 100))\n  console.log('second (after 100ms)')\n})\nqueue.push(() => {\n  console.log('third')\n})\n\n// Handle completion of the last task\nconst result = await queue.push(async (prev) => {\n  console.log('Got:', prev)\n  return 'done'\n})","lang":"typescript","description":"Creates an async queue, pushes three tasks that run in order, then shows chaining and await."},"warnings":[{"fix":"Always attach .catch() or use try/catch around await queue.push().","message":"If a task rejects and the error is not caught, the queue stalls permanently.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Provide an initial value if the first task expects a defined argument.","message":"createAsyncQueue() without arguments returns a queue with initial chaining value undefined.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ignore Travis badge; rely on GitHub status.","message":"Version 1.x uses Travis CI (obsolete); build status badge may not reflect current health.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Consider p-limit or async.queue if you need concurrency.","message":"The library does not support concurrency limits—all tasks are serial. For parallel with limit, use p-limit.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.2.2':28 '156':6 'async/queue':61 'async/sync':43 'asynchron':20 'browser':26 'byte':7 'cadenc':38 'chain':46,56 'concurr':73 'control':74 'current':31 'dead':15 'dead-simpl':14 'execut':41 'function':21,44 'generic':53 'gzip':8 'heavier':58 'javascript':77 'lack':72 'librari':59 'like':60 'limit':65 'low':37 'maintain':34 'minim':70 'nativ':19 'node.js':24 'p':64 'p-limit':63 'pico':2,10,67 'pico-queu':1,9,66 'prioriti':76 'provid':51 'queue':3,11,22,68 'releas':33 'result':47 'safe':55 'serial':40 'simpl':16 'stabl':32 'support':45 'task':49 'type':52 'typescript':18,78 'typescript-n':17 'unlik':57 'version':27","created_at":"2026-06-07T12:56:38.981440+00:00","updated_at":"2026-06-07T12:56:38.981440+00:00","problems":[{"fix":"import { createAsyncQueue } from 'pico-queue'","cause":"Default import used instead of named import.","error":"TypeError: createAsyncQueue is not a function"},{"fix":"Always handle rejections: await queue.push(...).catch(e => {}) or use try/catch.","cause":"A previous task rejected without a .catch handler, halting the queue permanently.","error":"Unhandled promise rejection: Error: queue.push on stalled 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/yuhsak/pico-queue#readme","github":"https://github.com/yuhsak/pico-queue","docs":null,"changelog":null,"pypi":null,"npm":"pico-queue","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","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}}