package
Check if something is a Node.js stream
npm install is-streamGitHub-flavored package documentation.
Across all versions, last 30 days.
1,080,046,416 in 30 days
Runtime metadata.
Tagged topics.
Check if something is a Node.js stream
npm install is-streamimport fs from 'node:fs';
import {isStream} from 'is-stream';
isStream(fs.createReadStream('unicorn.png'));
//=> true
isStream({});
//=> falseReturns a boolean for whether it's a Stream.
Returns a boolean for whether it's a stream.Writable, an http.OutgoingMessage, an http.ServerResponse or an http.ClientRequest.
Returns a boolean for whether it's a stream.Readable or an http.IncomingMessage.
Returns a boolean for whether it's a stream.Duplex.
Returns a boolean for whether it's a stream.Transform.
Type: boolean
Default: true
When this option is true, the method returns false if the stream has already been closed.
Estimated unpacked size across 1 packages.
7.4 kB
Includes dependencies.