Gathering detailed insights and metrics for rxjs-for-await
Gathering detailed insights and metrics for rxjs-for-await
Gathering detailed insights and metrics for rxjs-for-await
Gathering detailed insights and metrics for rxjs-for-await
A library for making RxJS support async-await for-await loops via AsyncIterables
npm install rxjs-for-await
Typescript
Module System
Node Version
NPM Version
87.7
Supply Chain
99.7
Quality
75.5
Maintenance
100
Vulnerability
100
License
TypeScript (73.89%)
JavaScript (26.11%)
Total Downloads
101,451,867
Last Day
4,824
Last Week
159,262
Last Month
657,844
Last Year
11,234,630
198 Stars
29 Commits
2 Forks
6 Watching
4 Branches
3 Contributors
Latest Version
1.0.0
Package Id
rxjs-for-await@1.0.0
Unpacked Size
141.96 kB
Size
26.51 kB
File Count
23
NPM Version
7.7.6
Node Version
14.15.4
Publised On
10 Nov 2021
Cumulative downloads
Total Downloads
Last day
-14.5%
4,824
Compared to previous day
Last week
-4.5%
159,262
Compared to previous week
Last month
-15.8%
657,844
Compared to previous month
Last year
-57.9%
11,234,630
Compared to previous year
1
A library for making RxJS support async-await for-await loops via AsyncIterables
This library exposes 4 different ways to consume an RxJS observable with an async/await for await..of
loop using AsyncIterable
. Each of these strategies has pros and cons, so be aware of those as you choose the one that suits your needs.
1async function example() { 2 const source$ = interval(100); 3 4 for await (const value of eachValueFrom(source$)) { 5 console.log(value); 6 } 7}
This strategy will yield every single value the observable source emits, one at a time, until the observable completes or errors.
for await
loop takes longer to come back around than the time between emissions from the observable source. If the observable emits faster than your loop can consume them, this may result in a memory leak.1async function example() { 2 const source$ = interval(10); 3 4 for await (const buffer of bufferedValuesFrom(source$)) { 5 console.log(buffer); 6 await wait(1000); 7 } 8}
Keep an internal buffer of values emitted by the observable source, and yield the entire buffer to the for await
loop. Continue this until the observable source completes or errors.
eachValueFrom
for await
loop is extremely slow.eachValueFrom
.1async function example() { 2 const source$ = interval(100); 3 4 for await (const value of latestValueFrom(source$)) { 5 console.log(value); 6 } 7}
This strategy will immediately yield the most recently arrived value, or the very next one, if the for await
loop is waiting and one has not arrived yet. Will continue
to do so until the source observable completes or errors.
1async function example() { 2 const source$ = interval(100); 3 4 for await (const value of nextValueFrom(source$)) { 5 console.log(value); 6 } 7}
Will wait for the very next value to arrive, then yield it. Will continue to do so until the source observable completes or errors.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 2/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
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
15 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
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 Moreevt
Type safe replacement for node's EventEmitter
async-await-rx
Extension for rxjs library
@nathanpb/rxjs-async-iterator
Converts async iterators from RxJS observables to consume in for-await-of loops
rxjs-async-iterator
Converts async iterators from RxJS observables to consume in for-await-of loops