A lightweight promise queue library (v2.0.0) for pull-based async task handling. Pushed promises are resolved in FIFO order when pulled. Supports abort via AbortController. Ships TypeScript type definitions. ESM and CJS compatible. Key differentiator: designed specifically for pull-based patterns where consumers wait for results before producers push them, unlike push-based queues (e.g., p-limit, p-queue).
npm install promise-pull-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a pull queue, pushes promises, and pulls results in order. Demonstrates push-then-pull, deferred resolution, and late push.
Use default import in ESM: import PullQueue from 'promise-pull-queue' or CommonJS: require('promise-pull-queue').defaultPass a valid AbortSignal: queue.pull(signal). If signal is already aborted, pull will reject immediately.
Always ensure that eventually a push occurs, or use AbortController to cancel pending pulls.
Always wrap non-promise values in Promise.resolve(): queue.push(Promise.resolve(value))
Change to: const PullQueue = require('promise-pull-queue').default;Change to: const queue = PullQueue();
Check signal.aborted before pulling, or handle the rejection properly.
No dependency data recorded yet.