
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
stream-to-async-iterator
Advanced tools
stream-to-async-iterator
provides a wrapper that implements Symbol.asyncIterator
. This will allow streams to be
usable as async iterables that can be used in for-await-of loops.
Supports node.js 12 and up.
With NPM:
npm install stream-to-async-iterator
With Yarn:
yarn add stream-to-async-iterator
The included examples use async/await syntax for for-of loops. This assumes you are in an environment that natively
supports this new syntax, or that you use a tool such as Babel. In addition, for async iterators to work properly,
the Symbol.asyncIterator
symbol must be defined. Core-js can help with that.
Import the StreamToAsyncIterator class and pass the stream to its constructor. The iterator instance can be directly used in for-of contexts.
If the stream is in object mode, each iteration will produce the next object. See the node documentation for more information.
#!/usr/bin/env node
"use strict";
const { Readable } = require("stream");
const S2A = require("../").default;
(async function () {
const readStream = Readable.from([1, 2, 3]);
for await (const chunk of new S2A(readStream)) {
console.dir({ chunk });
}
})();
Outputs:
{ chunk: 1 }
{ chunk: 2 }
{ chunk: 3 }
v1.0.0
.throw
and .return
hooks on the async iterator.FAQs
ES async interator wrapper for node streams
The npm package stream-to-async-iterator receives a total of 7,586 weekly downloads. As such, stream-to-async-iterator popularity was classified as popular.
We found that stream-to-async-iterator 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.