
Security News
Node.js Moves Toward Stable TypeScript Support with Amaro 1.0
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
queue-that-promise
Advanced tools
Push promises to a queue. The queue runs in order. That's all. 500b gzipped.
$ npm install --save queue-that-promise
var Queue = require('queue-that-promise')
var queue = Queue()
queue.add(() => new Promise((resolve) => setTimeout(resolve, 100))
.then(() => console.log('first'))
queue.add(() => new Promise((resolve) => setTimeout(resolve, 100))
.then(() => console.log('second'))
queue.add(() => new Promise((resolve) => setTimeout(resolve, 100))
.then(() => console.log('third'))
queue.done().then(() => console.log('done'))
// Wait 100ms...
// => "first"
// Wait 100ms...
// => "second"
// Wait 100ms...
// => "third"
// => "done"
Queue()
-> queue
Returns a queue instance.
queue.done() -> Promise
Returns a promise that will be resolved once the queue is empty.
queue.add(callback<Promise> | Array<callback<Promise>>) -> Promise
Adds a callback or multiple callbacks to the queue.
The callback will run after all previously added callbacks have finished.
Returns a promise that will be resolved or rejected once the given callback's returned promise is resolved or rejected.
queue.count() -> number
Returns the current length of the queue.
MIT © Andrew Joslin
FAQs
Push promises to a queue. The queue runs. That's all.
The npm package queue-that-promise receives a total of 91 weekly downloads. As such, queue-that-promise popularity was classified as not popular.
We found that queue-that-promise 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
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.