GitShow/sindresorhus/p-queue
sindresorhus

p-queue

Promise queue with concurrency control

by sindresorhus
async-functionsasync-queuenode-modulenpm-packagepromisepromise-queuequeuequeue-data-stucture
Star on GitHubForknpm

TypeScript

4.2k stars212 forks37 contributorsActive · 2d agoSince 2016v9.3.1MIT

Meet the team

See all 37 on GitHub →
sindresorhus
sindresorhus131 contributions
Richienb
Richienb13 contributions
floatdrop
floatdrop9 contributions
Rafael09ED
Rafael09ED3 contributions
onury
onury2 contributions
ltetzlaff
ltetzlaff2 contributions
edorivai
edorivai2 contributions
dobesv
dobesv2 contributions

Languages

View on GitHub →
TypeScript100%

Commit activity

Last 12 weeks · 8 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Active · 3 in progress · Last activity 2d ago
See all on GitHub →
Richienb
Use native `EventTarget` instead of `EventEmitter`OpenPR

Completely works on Node.js 25. Will want to wait for Node.js 26 to be released and grow mature. Fixes #162

Richienb · 2mo ago
Richienb
Allow modifying `interval` and `intervalCap`OpenPR

Fixes #177

Richienb · 2mo ago

Recent fixes

View closed PRs →
hong4rc
onSizeLessThan() resolves late when the queue drains without a completionClosedIssue

can resolve much later than it should. It only re-checks its condition on task completions, so when the queue drains below the limit without a task finishing, the returned promise stays pending until the next unrelated completion. Raising at runtime on a running queue shows the same shape: several tasks are dequeued synchronously and falls below the limit, but doesn't settle until a task later completes. The everyday completion-driven case (a running queue whose size falls as tasks finish) resolves promptly, so the gap is specific to non-completion drains: + , a runtime increase, and interval ticks under rate limiting. Mechanism: waits on the event, and is emitted on task completion (), on a queued-task abort, and in . The bulk-dequeue in emits / / but not , so any size decrease that isn't a completion never wakes the waiter. The queued-abort handler already emits right after it removes an item from the queue — so the intended contract looks like "emit whenever the waiting set shrinks," and the dequeue path just doesn't follow it. Emitting after a successful in (guarding against a double-emit on the completion path, which also calls it) would line the two up. Happy to send a PR if that direction sounds right.

hong4rc · 2d ago
Rohan5commit
docs: clarify autoStart README wordingMergedPR

Summary clarify the autoStart sentence in the README Related issue N/A (trivial docs wording fix) Guideline alignment CONTRIBUTING: none found in the repo root or .github on main PR template: none found in the repo root or .github on main Validation Not run (docs-only change)

Rohan5commit · 1mo ago
chu0119
Enhancement: add timeoutRemaining to running task infoClosedIssue

Feature request The getter provides useful debug information about currently executing tasks (id, priority, startTime, timeout). However, it doesn't expose how much time is remaining before a task times out. Proposed solution Add a computed field to each running task entry that shows the remaining timeout in milliseconds: Use case This would be useful for monitoring and debugging long-running tasks, allowing users to see at a glance which tasks are about to time out.

chu0119 · 1mo ago
Structured data for AI agents

Repository: sindresorhus/p-queue. Description: Promise queue with concurrency control Stars: 4230, Forks: 212. Primary language: TypeScript. Languages: TypeScript (100%). License: MIT. Topics: async-functions, async-queue, node-module, npm-package, promise, promise-queue, queue, queue-data-stucture. Latest release: v9.3.1 (2d ago). Open PRs: 3, open issues: 2. Last activity: 2d ago. Community health: 85%. Top contributors: sindresorhus, Richienb, floatdrop, Rafael09ED, onury, ltetzlaff, edorivai, dobesv, BendingBender, bobjflong and others.

·@ofershap

Replace github.com with gitshow.dev