Gathering detailed insights and metrics for destroy
Gathering detailed insights and metrics for destroy
Gathering detailed insights and metrics for destroy
Gathering detailed insights and metrics for destroy
npm install destroy
98.9
Supply Chain
86.3
Quality
77.7
Maintenance
100
Vulnerability
100
License
Module System
Unable to determine the module system for this package.
Min. Node Version
Typescript Support
Node Version
NPM Version
56 Stars
130 Commits
9 Forks
6 Watching
2 Branches
6 Contributors
Updated on 24 Jul 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-2.7%
6,851,788
Compared to previous day
Last week
3.1%
37,139,858
Compared to previous week
Last month
11.5%
152,397,555
Compared to previous month
Last year
4.8%
1,619,417,619
Compared to previous year
Destroy a stream.
This module is meant to ensure a stream gets destroyed, handling different APIs and Node.js bugs.
1var destroy = require('destroy')
Destroy the given stream, and optionally suppress any future error
events.
In most cases, this is identical to a simple stream.destroy()
call. The rules
are as follows for a given stream:
stream
is an instance of ReadStream
, then call stream.destroy()
and add a listener to the open
event to call stream.close()
if it is
fired. This is for a Node.js bug that will leak a file descriptor if
.destroy()
is called before open
.stream
is an instance of a zlib stream, then call stream.destroy()
and close the underlying zlib handle if open, otherwise call stream.close()
.
This is for consistency across Node.js versions and a Node.js bug that will
leak a native zlib handle.stream
is not an instance of Stream
, then nothing happens.stream
has a .destroy()
method, then call it.The function returns the stream
passed in as the argument.
1var destroy = require('destroy') 2 3var fs = require('fs') 4var stream = fs.createReadStream('package.json') 5 6// ... and later 7destroy(stream)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities 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
Found 1/30 approved changesets -- 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
Score
Last Scanned on 2024-11-18
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