Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
merge-async-iterators
Advanced tools
A simple async iterators merger
Requires ES2018 Async Iteration
npm i merge-async-iterators
merge([...iterators], opts)
iterators
Array of async iterables
opts
yieldIterator[=false]
Yields {iterator, value}
(instead of value
)
Useful if you wanna know which iterator yielded the value
Returns A single merged async iterable
const merge = require('merge-async-iterators');
const array = [1,2];
const iterable = (function*(){
yield 3
yield 4
})()
const asyncIterable = (async function*(){
yield 5
yield 6
})()
for await (const value of merge([array, iterable, asyncIterable])) {
console.log(value)
}
1
2 // order isn't guaranteed
undefined // finished iterators' returns will yield as well
3
4
undefined
5 // async wil almost always come after normal ones
6
FAQs
Merge multiple async iterators
The npm package merge-async-iterators receives a total of 93 weekly downloads. As such, merge-async-iterators popularity was classified as not popular.
We found that merge-async-iterators 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.