Gathering detailed insights and metrics for stream-to-async-iterator
Gathering detailed insights and metrics for stream-to-async-iterator
Gathering detailed insights and metrics for stream-to-async-iterator
Gathering detailed insights and metrics for stream-to-async-iterator
ES async iterator wrapper for node streams
npm install stream-to-async-iterator
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (90.71%)
JavaScript (9.29%)
Total Downloads
2,593,528
Last Day
3,107
Last Week
14,346
Last Month
56,210
Last Year
550,075
MIT License
38 Stars
28 Commits
2 Forks
1 Watchers
3 Branches
2 Contributors
Updated on Jul 25, 2023
Latest Version
1.0.0
Package Id
stream-to-async-iterator@1.0.0
Unpacked Size
13.76 kB
Size
4.62 kB
File Count
5
NPM Version
8.1.2
Node Version
16.13.2
Cumulative downloads
Total Downloads
Last Day
113%
3,107
Compared to previous day
Last Week
2.2%
14,346
Compared to previous week
Last Month
24.4%
56,210
Compared to previous month
Last Year
7.5%
550,075
Compared to previous year
24
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:
1npm install stream-to-async-iterator
With Yarn:
1yarn 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.
1#!/usr/bin/env node 2"use strict"; 3const { Readable } = require("stream"); 4const S2A = require("../").default; 5 6(async function () { 7 const readStream = Readable.from([1, 2, 3]); 8 for await (const chunk of new S2A(readStream)) { 9 console.dir({ chunk }); 10 } 11})();
Outputs:
{ chunk: 1 }
{ chunk: 2 }
{ chunk: 3 }
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/25 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
11 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More