Gathering detailed insights and metrics for minipass-flush
Gathering detailed insights and metrics for minipass-flush
Gathering detailed insights and metrics for minipass-flush
Gathering detailed insights and metrics for minipass-flush
A Minipass stream that calls a flush function before emitting 'end'
npm install minipass-flush
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
ISC License
3 Stars
24 Commits
2 Forks
2 Watchers
4 Branches
2 Contributors
Updated on Feb 17, 2022
Latest Version
1.0.5
Package Id
minipass-flush@1.0.5
Size
1.93 kB
NPM Version
6.12.0-next.0
Node Version
12.8.1
Published on
Sep 30, 2019
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
A Minipass stream that calls a flush function before emitting 'end'
1const Flush = require('minipass-flush')
2cons f = new Flush({
3 flush (cb) {
4 // call the cb when done, or return a promise
5 // the 'end' event will wait for it, along with
6 // close, finish, and prefinish.
7 // call the cb with an error, or return a rejecting
8 // promise to emit 'error' instead of doing the 'end'
9 return rerouteAllEncryptions().then(() => clearAllChannels())
10 },
11 // all other minipass options accepted as well
12})
13
14someDataSource.pipe(f).on('end', () => {
15 // proper flushing has been accomplished
16})
17
18// Or as a subclass implementing a 'flush' method:
19class MyFlush extends Flush {
20 flush (cb) {
21 // old fashioned callback style!
22 rerouteAllEncryptions(er => {
23 if (er)
24 return cb(er)
25 clearAllChannels(er => {
26 if (er)
27 cb(er)
28 cb()
29 })
30 })
31 }
32}
That's about it.
If your flush
method doesn't have to do anything asynchronous, then it's
better to call the callback right away in this tick, rather than returning
Promise.resolve()
, so that the end
event can happen as soon as
possible.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
13 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