{"id":45171,"library":"it-queueless-pushable","title":"it-queueless-pushable","description":"A pushable async generator that waits until the current value is consumed before allowing a new value to be pushed. Useful for controlling memory usage and data flow in async iterators. Version 2.0.5 is the latest stable release. It is part of the 'it' monorepo by achingbrain. Unlike a standard pushable that queues all values, this variant enforces backpressure by having push() return a promise that resolves only after the value is consumed. Ships TypeScript types. Typically used in conjunction with other 'it' packages for streaming data processing. The package is ESM-only starting from version 3 (currently v2 supports both CJS and ESM).","status":"active","version":"2.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/achingbrain/it","tags":["javascript","typescript"],"install":[{"cmd":"npm install it-queueless-pushable","lang":"bash","label":"npm"},{"cmd":"yarn add it-queueless-pushable","lang":"bash","label":"yarn"},{"cmd":"pnpm add it-queueless-pushable","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CommonJS require() works in v2 but may break in future ESM-only releases.","wrong":"const queuelessPushable = require('it-queueless-pushable')","symbol":"queuelessPushable","correct":"import { queuelessPushable } from 'it-queueless-pushable'"},{"note":"QueuelessPushable is a TypeScript type, not a runtime export. Use type import or import type.","wrong":"import { QueuelessPushable } from 'it-queueless-pushable'","symbol":"QueuelessPushable","correct":"import type { QueuelessPushable } from 'it-queueless-pushable'"},{"note":"This package has both a named and default export. Default export is the same function, but prefer named import for clarity.","wrong":"const queuelessPushable = require('it-queueless-pushable').default","symbol":"default export","correct":"import queuelessPushable from 'it-queueless-pushable'"}],"quickstart":{"code":"import { queuelessPushable } from 'it-queueless-pushable'\n\nconst pushable = queuelessPushable<string>()\n\n// Producer: push a value asynchronously, it waits until consumed\nasync function producer() {\n  await pushable.push('hello')\n  console.log('value pushed and consumed')\n}\n\n// Consumer: read values via async iteration\nasync function consumer() {\n  for await (const value of pushable) {\n    console.log('received:', value)\n    // after this log, the push promise resolves\n    break\n  }\n}\n\nproducer()\nconsumer()","lang":"typescript","description":"Demonstrates basic backpressure: push() resolves only after the value is consumed by the async iterator."},"warnings":[{"fix":"Use import syntax or dynamic import(). If you need CommonJS, stick to v2.","message":"In v3, this package will be ESM-only and drop CommonJS support.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Ensure producer and consumer run concurrently (e.g., in separate async functions or using Promise.resolve().then()).","message":"Push resolved promise order: If multiple push() calls are made before any consumption, they will not queue; push() will never resolve until previous values are consumed. This can lead to deadlocks if both producer and consumer are synchronous.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use named import: import { queuelessPushable } from 'it-queueless-pushable'","message":"The package originally had a default export; the named export queuelessPushable is preferred.","severity":"deprecated","affected_versions":">=2.0.0 <3.0.0"},{"fix":"Always push non-null, non-undefined values, or handle errors.","message":"Cannot push null or undefined values; the pushable expects valid values and may throw or behave unexpectedly.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'2.0.5':37 '3':102 'achingbrain':51 'allow':18 'async':7,34 'backpressur':63 'cjs':107 'conjunct':84 'consum':16,77 'control':27 'current':13,103 'data':31,91 'enforc':62 'esm':97,109 'esm-on':96 'flow':32 'generat':8 'it-queueless-push':1 'iter':35 'javascript':110 'latest':40 'memori':28 'monorepo':49 'new':20 'packag':88,94 'part':45 'process':92 'promis':69 'push':24,66 'pushabl':4,6,55 'queue':57 'queueless':3 'releas':42 'resolv':71 'return':67 'ship':78 'stabl':41 'standard':54 'start':99 'stream':90 'support':105 'type':80 'typescript':79,111 'typic':81 'unlik':52 'usag':29 'use':25,82 'v2':104 'valu':14,21,59,75 'variant':61 'version':36,101 'wait':10","created_at":"2026-06-07T12:53:42.665098+00:00","updated_at":"2026-06-07T12:53:42.665098+00:00","problems":[{"fix":"Use import { queuelessPushable } from 'it-queueless-pushable'","cause":"Using CommonJS require() on ESM-only build or incorrect import path.","error":"TypeError: queuelessPushable is not a function"},{"fix":"Check pushable state before pushing, or do not end early.","cause":"Calling push() after end() has been called.","error":"Error: Cannot push to a pushable that is already ended"},{"fix":"Ensure consumer runs concurrently, e.g., via Promise.resolve().then(() => consume())","cause":"Synchronous push and no concurrent consumer: push() waits indefinitely.","error":"Promise never resolves / deadlock"}],"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/achingbrain/it/tree/main/packages/it-queueless-pushable#readme","github":"https://github.com/achingbrain/it","docs":null,"changelog":null,"pypi":null,"npm":"it-queueless-pushable","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}}