Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
mergeiterator
Advanced tools
Merges async iterators.
Merges list of async or sync iterables into async one.
It accepts any iterable like arrays, generators, async generators or even promises which resolve to iterables. Any iterator can be infinite, including the list of iterables itself.
import merge from "mergeiterator"
async function DoIt() {
for await (const v of merge([
[1, 2, Promise.resolve(3)],
Promise.resolve([4, 5]),
(function*() {
let i = 9
while (true) {
yield i++
yield Promise.resolve(i++)
}
})(),
(async function*() {
yield 6
yield await Promise.resolve(7)
yield Promise.resolve(8)
})(),
])) {
console.log(v)
}
}
// 1 4 2 9 5 3 10 6 11 7 12 8 13 14 15 16 17 18 19 20 ...
This function guarantees, that if some value is yielded by some of iterables, then that value will be eventually yielded. This is basically about infinite iterables. It also guarantees that the order of values within the same iterable is preserved.
If some iterable yields a promise, its value will be used, not a promise itself.
If some iterable throws an error, that error will be redirected to a caller and other iterables will be closed.
Return values of iterables are discarded.
Merges async or sync iterables into async one.
sequences
AnyIterable<AnyIterable<T>>Returns AsyncGenerator<T, any, any>
1.4.4
security:
FAQs
merges async iterators
The npm package mergeiterator receives a total of 640 weekly downloads. As such, mergeiterator popularity was classified as not popular.
We found that mergeiterator 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.