
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Yet another concurrent priority task queue, yay!
npm install yqueue
Returns a new queue
instance.
Type: object
Type: number
Default: 10
Minimum: 1
Concurrency limit.
YQueue
instance.
Adds a sync or async task to the queue. Always returns a promise.
Note: If your items can potentially throw an exception, you must handle those errors from the returned Promise or they may be reported as an unhandled Promise rejection and potentially cause your process to exit immediately.
Type: Function
Promise-returning/async function.
Type: object
Type: number
Default: 0
Priority of operation. Operations with greater priority will be scheduled first.
Adds a sync or async task to the queue. The only difference from run
is that it returns nothing.
Returns a promise that settles when the queue becomes empty, and all promises have completed.
Returns a promise that settles when the queue size is less than the given limit.
If you want to avoid having the queue grow beyond a certain size you can await queue.onQueueSizeLessThan(size)
before adding a new item.
Note that this only limits the number of items waiting to start. There could still be up to concurrency
jobs already running that this call does not include in its calculation.
Returns a new batch
instance.
Type: object
Type: number
Default: 10
Minimum: 1
Concurrency limit.
Type: number
Default: the value of concurrency
Minimum: 1
Wait until queue size is less than this limit before adding new tasks.
YBatch
instance.
Adds a sync or async task to the batch. Always returns a promise, which will be settled once the queue size is less than maxQueueLength
limit and the task added to the queue.
Type: Function
Promise-returning/async function.
Type: object
Type: number
Default: 0
Priority of operation. Operations with greater priority will be scheduled first.
Returns a promise that settles when any of the tasks throws an error or all tasks have completed.
Returns a promise that settles when all tasks have completed, all promise rejections from the tasks will be wrapped as a YBatchErrors
class, which put all errors in the errors
field.
FAQs
Yet another concurrent task queue
The npm package yqueue receives a total of 1,245 weekly downloads. As such, yqueue popularity was classified as popular.
We found that yqueue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.