{"id":44312,"library":"async-iterable-queue","title":"async-iterable-queue","description":"A lightweight TypeScript library providing an AsyncIterableQueue<T> class that implements both AsyncIterable<T> and async push/end methods. Version 1.0.16, released as needed with no fixed cadence. It allows producers to push items and consumers to iterate asynchronously using for-await-of. Unlike other async queue libraries, it integrates directly with JavaScript's async iteration protocol, supports TypeScript, and has zero dependencies. It requires Node.js >=14.17.5 and is ESM-only.","status":"active","version":"1.0.16","language":"javascript","source_language":"en","source_url":"https://github.com/kei-g/async-iterable-queue","tags":["javascript","async","asynchronous","asynciterable","asynciterator","iterable","queue","typescript"],"install":[{"cmd":"npm install async-iterable-queue","lang":"bash","label":"npm"},{"cmd":"yarn add async-iterable-queue","lang":"bash","label":"yarn"},{"cmd":"pnpm add async-iterable-queue","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is ESM-only; CommonJS require() will throw.","wrong":"const { AsyncIterableQueue } = require('async-iterable-queue')","symbol":"AsyncIterableQueue","correct":"import { AsyncIterableQueue } from 'async-iterable-queue'"},{"note":"Only named export exists.","wrong":"The package does not export a default.","symbol":"default import","correct":"import AsyncIterableQueue from 'async-iterable-queue'"},{"note":"Use type import when only using as a type to avoid bundling issues.","wrong":"Using value import for type-only contexts.","symbol":"type import","correct":"import type { AsyncIterableQueue } from 'async-iterable-queue'"}],"quickstart":{"code":"import { AsyncIterableQueue } from 'async-iterable-queue';\n\nasync function main() {\n  const queue = new AsyncIterableQueue<string>();\n  // Producer\n  setTimeout(() => {\n    queue.push('hello');\n    queue.push('world');\n    queue.end();\n  }, 100);\n  // Consumer\n  for await (const item of queue) {\n    console.log(item);\n  }\n}\nmain().catch(console.error);","lang":"typescript","description":"Creates an AsyncIterableQueue, pushes two items, ends the queue, and consumes them with for-await-of."},"warnings":[{"fix":"Use import statements and ensure your project is configured for ESM (e.g., 'type': 'module' in package.json).","message":"ESM-only: package does not support CommonJS require().","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Ensure you call end() only after all pushes are complete, and handle rejection on push.","message":"Queue must be consumed after end() is called or push() will reject.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always check if queue has ended before pushing, or catch errors.","message":"Calling push() after end() will throw an error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Install with 'npm i async-iterable-queue' (s with 'async' not 'asyn').","message":"The package name is 'async-iterable-queue' not 'async-iterable-queue' (no typo).","severity":"breaking","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.0.16':22 '14.17.5':69 'allow':31 'async':2,18,48,57,76 'async-iterable-queu':1 'asynchron':40,77 'asynciter':16,78,79 'asynciterablequeu':11 'await':44 'cadenc':29 'class':12 'consum':37 'depend':65 'direct':53 'esm':73 'esm-on':72 'fix':28 'for-await-of':42 'implement':14 'integr':52 'item':35 'iter':3,39,58,80 'javascript':55,75 'librari':8,50 'lightweight':6 'method':20 'need':25 'node.js':68 'produc':32 'protocol':59 'provid':9 'push':34 'push/end':19 'queue':4,49,81 'releas':23 'requir':67 'support':60 'typescript':7,61,82 'unlik':46 'use':41 'version':21 'zero':64","created_at":"2026-06-07T12:49:31.716155+00:00","updated_at":"2026-06-07T12:49:31.716155+00:00","problems":[{"fix":"Add 'type': 'module' to your package.json or use .mjs extension.","cause":"Running ESM code in a CommonJS project.","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Use new AsyncIterableQueue<T>() to create an instance.","cause":"Forgetting the 'new' keyword when instantiating.","error":"TypeError: Class constructor AsyncIterableQueue cannot be invoked without 'new'"},{"fix":"Use import { AsyncIterableQueue } from 'async-iterable-queue'.","cause":"Attempting to use a default import instead of named import.","error":"TypeError: queue.push is not a function"}],"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/kei-g/async-iterable-queue","github":"https://github.com/kei-g/async-iterable-queue","docs":null,"changelog":null,"pypi":null,"npm":"async-iterable-queue","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"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}}