Gathering detailed insights and metrics for @basic-streams/from-iterable
Gathering detailed insights and metrics for @basic-streams/from-iterable
Gathering detailed insights and metrics for @basic-streams/from-iterable
Gathering detailed insights and metrics for @basic-streams/from-iterable
npm install @basic-streams/from-iterable
Typescript
Module System
Node Version
NPM Version
TypeScript (83.84%)
JavaScript (16.16%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
70 Stars
248 Commits
4 Forks
5 Watchers
1 Branches
2 Contributors
Updated on Feb 20, 2025
Latest Version
0.0.12
Package Id
@basic-streams/from-iterable@0.0.12
Unpacked Size
10.88 kB
Size
3.66 kB
File Count
8
NPM Version
6.1.0
Node Version
10.5.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
1fromIterable<T>( 2 iterable: Iterable<T>, 3 interval?: number, 4 scheduler?: (time: number) => Stream<void> 5): Stream<T>
Transforms an iterable
into a stream.
1import fromIterable from "@basic-streams/from-iterable" 2 3fromIterable([1, 2, 3])(x => { 4 console.log(x) 5}) 6 7// > 1 8// > 2 9// > 3
If an interval
is provided the events will be spread in time by that ammount
of milliseconds, with the first one delayed. If the interval is 0
the events
will be produced as soon as possible but still asynchronously.
1import fromIterable from "@basic-streams/from-iterable" 2 3fromIterable([1, 2, 3], 5000)(x => { 4 console.log(x) 5}) 6 7// > 1 8// > 2 9// > 3 10 11// ____1____2____3
Note that the iterable is consumed lazily, meaning that next()
is called only
when value is needed.
1import fromIterable from "@basic-streams/from-iterable" 2 3function* generator() { 4 const startTime = Date.now() 5 yield Date.now() - startTime 6 yield Date.now() - startTime 7 yield Date.now() - startTime 8} 9fromIterable(generator(), 5000)(x => { 10 console.log(x) 11}) 12 13// > 0 14// > 5000 15// > 10000 16 17// 0 5000 10000 18// ____.____.____.
You can provide a custom scheduler
, a function that creates a stream producing
an event after the given time. By default later
is used as a
scheduler.
1import fromIterable from "@basic-streams/from-iterable" 2import later from "@basic-streams/later" 3 4function scheduler(time) { 5 return later(time / 2) 6} 7fromIterable([1, 2, 3], 6000, scheduler)(x => { 8 console.log(x) 9}) 10 11// > 1 12// > 2 13// > 3 14 15// __1__2__3
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/19 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
48 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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