Gathering detailed insights and metrics for stream-to-it
Gathering detailed insights and metrics for stream-to-it
Gathering detailed insights and metrics for stream-to-it
Gathering detailed insights and metrics for stream-to-it
🚰 Convert Node.js streams to streaming iterables
npm install stream-to-it
Typescript
Module System
Node Version
NPM Version
99.7
Supply Chain
100
Quality
75.8
Maintenance
100
Vulnerability
100
License
TypeScript (97.31%)
JavaScript (2.69%)
Total Downloads
15,634,959
Last Day
12,573
Last Week
85,207
Last Month
380,262
Last Year
3,828,933
NOASSERTION License
18 Stars
33 Commits
7 Forks
3 Watchers
6 Branches
5 Contributors
Updated on Apr 15, 2024
Latest Version
1.0.1
Package Id
stream-to-it@1.0.1
Unpacked Size
37.50 kB
Size
9.76 kB
File Count
30
NPM Version
10.5.1
Node Version
20.12.1
Published on
Apr 09, 2024
Cumulative downloads
Total Downloads
Last Day
3.1%
12,573
Compared to previous day
Last Week
1%
85,207
Compared to previous week
Last Month
2.2%
380,262
Compared to previous month
Last Year
1.1%
3,828,933
Compared to previous year
1
Convert Node.js streams to streaming iterables
Seamlessly use Node.js streams with it-pipe
and friends.
1import fs from 'node:fs' 2import * as toIterable from 'stream-to-it' 3 4const readable = fs.createReadStream('/path/to/file') 5// Node.js streams are already async iterable so this is just s => s 6const source = toIterable.source<Buffer>(readable) 7 8for await (const chunk of source) { 9 console.log(chunk.toString()) 10}
Also works with browser ReadableStream
:
1import * as toIterable from 'stream-to-it' 2 3const res = await fetch('http://example.org/file.jpg') 4 5if (res.body == null) { 6 throw new Error('Body was not set') 7} 8 9for await (const chunk of toIterable.source(res.body)) { 10 console.log(chunk.toString()) 11}
1import fs from 'node:fs' 2import { pipe } from 'it-pipe' 3import * as toIterable from 'stream-to-it' 4 5const source = [Buffer.from('Hello '), Buffer.from('World!')] 6const sink = toIterable.sink(fs.createWriteStream('/path/to/file')) 7 8await pipe(source, sink)
1import fs from 'node:fs' 2import { Transform } from 'node:stream' 3import { pipe } from 'it-pipe' 4import * as toIterable from 'stream-to-it' 5 6const output = await pipe( 7 [true, false, true, true], 8 toIterable.transform(new Transform({ // Inverter transform :) 9 transform (chunk, enc, cb) { 10 cb(null, !chunk) 11 } 12 })), 13 // Collect and return the chunks 14 async source => { 15 const chunks = [] 16 for await (const chunk of source) chunks.push(chunk) 17 return chunks 18 } 19) 20 21console.log(output) // [ false, true, false, false ]
it-to-stream
Convert streaming iterables to Node.js streamsit-pipe
Utility to "pipe" async iterables together1$ npm i stream-to-it
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
Found 6/24 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
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