Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@supercharge/promise-pool
Advanced tools
Changelog
1.2.0 - 2019-10-15
.withConcurrency
and .for
new Pool().for(items)
is now Pool.for(items)
)new Pool().withConcurrency(2)
is now Pool.withConcurrency(2)
)Readme
Map-like, concurrent promise processing for Node.js.
Installation · Docs · Usage · API
Follow @marcuspoehls and @superchargejs for updates!
npm i @supercharge/promise-pool
Find all the details and available methods in the extensive Supercharge docs.
Using the promise pool is pretty straightforward. The pacakge exposes a class and you can create a promise pool instance using the fluent interface.
Here’s an example using the default concurrency of 10:
const PromisePool = require('@supercharge/promise-pool')
const users = [
{ name: 'Marcus' },
{ name: 'Norman' },
{ name: 'Christian' }
]
const { results, errors } = await PromisePool
.for(users)
.process(async data => {
const user = await User.createIfNotExisting(data)
return user
})
You can surely refine the concurrency to your needs using the .withConcurrency
method:
await PromisePool
.for(users)
.withConcurrency(2)
.process(async data => {
//
})
git checkout -b my-feature
git commit -am 'Add some feature'
git push origin my-new-feature
MIT © Supercharge
superchargejs.com · GitHub @superchargejs · Twitter @superchargejs
FAQs
Map-like, concurrent promise processing for Node.js
The npm package @supercharge/promise-pool receives a total of 367,469 weekly downloads. As such, @supercharge/promise-pool popularity was classified as popular.
We found that @supercharge/promise-pool demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.