Gathering detailed insights and metrics for isstream
Gathering detailed insights and metrics for isstream
Gathering detailed insights and metrics for isstream
Gathering detailed insights and metrics for isstream
npm install isstream
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
63 Stars
10 Commits
4 Forks
4 Watching
1 Branches
2 Contributors
Updated on 21 Oct 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-7.6%
3,754,705
Compared to previous day
Last week
3.6%
23,193,105
Compared to previous week
Last month
25.7%
88,504,645
Compared to previous month
Last year
-10.4%
877,388,010
Compared to previous year
5
Test if an object is a Stream
The missing Stream.isStream(obj)
: determine if an object is standard Node.js Stream
. Works for Node-core Stream
objects (for 0.8, 0.10, 0.11, and in theory, older and newer versions) and all versions of readable-stream.
1var isStream = require('isstream') 2var Stream = require('stream') 3 4isStream(new Stream()) // true 5 6isStream({}) // false 7 8isStream(new Stream.Readable()) // true 9isStream(new Stream.Writable()) // true 10isStream(new Stream.Duplex()) // true 11isStream(new Stream.Transform()) // true 12isStream(new Stream.PassThrough()) // true
You can also test for isReadable(obj)
, isWritable(obj)
and isDuplex(obj)
to test for implementations of Streams2 (and Streams3) base classes.
1var isReadable = require('isstream').isReadable 2var isWritable = require('isstream').isWritable 3var isDuplex = require('isstream').isDuplex 4var Stream = require('stream') 5 6isReadable(new Stream()) // false 7isWritable(new Stream()) // false 8isDuplex(new Stream()) // false 9 10isReadable(new Stream.Readable()) // true 11isReadable(new Stream.Writable()) // false 12isReadable(new Stream.Duplex()) // true 13isReadable(new Stream.Transform()) // true 14isReadable(new Stream.PassThrough()) // true 15 16isWritable(new Stream.Readable()) // false 17isWritable(new Stream.Writable()) // true 18isWritable(new Stream.Duplex()) // true 19isWritable(new Stream.Transform()) // true 20isWritable(new Stream.PassThrough()) // true 21 22isDuplex(new Stream.Readable()) // false 23isDuplex(new Stream.Writable()) // false 24isDuplex(new Stream.Duplex()) // true 25isDuplex(new Stream.Transform()) // true 26isDuplex(new Stream.PassThrough()) // true
Reminder: when implementing your own streams, please use readable-stream rather than core streams.
isStream is Copyright (c) 2015 Rod Vagg @rvagg and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/10 approved changesets -- score normalized to 1
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
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
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