
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
asyncforeach
Advanced tools
Lightweight async Array-forEach-method.
In a microservice world, you want to fire requests in parallel and act on all of their returns. This can be done very barebones with this tiny module.
For better support and lifetime handling, as well as a better API go to Steed.
const arr = []
arr.push(function one (task, index, array, cb) {
process.nextTick(() => {
return cb(null, {'one': 'one'})
})
})
arr.push(function two (task, index, array, cb) {
console.log('calling two')
setTimeout(function () {
return cb(null, {'two': 'two'})
}, 1000)
})
asyncForEach(arr, (err, res) => {
console.log(err) // null
console.log(res) // [ {'one': 'one'}, {'two': 'two'} ]
// order is guaranteed
})
or with an error:
const arr = []
arr.push(function one (task, index, array, cb) {
process.nextTick(() => {
return cb(new Error('Simple Error'), {'one': 'one'})
})
})
arr.push(function two (task, index, array, cb) {
console.log('calling two')
setTimeout(function () {
return cb(new Error(), {'two': 'two'})
}, 1000)
})
asyncForEach(arr, (err, res) => {
console.log(err) // err instanceof Error -> true
console.log(res) // undefined
})
countless
aysnc
Promise
(WIP)
MIT
FAQs
Lightweight async Array-forEach-method.
The npm package asyncforeach receives a total of 76 weekly downloads. As such, asyncforeach popularity was classified as not popular.
We found that asyncforeach demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.