@cjser/is-stream__v3_0_0
v3.0.0-cjser.2
Published
Check if something is a Node.js stream
Downloads
22
Maintainers
Readme
is-stream
Check if something is a Node.js stream
Install
$ npm install is-streamUsage
import fs from 'node:fs';
import {isStream} from 'is-stream';
isStream(fs.createReadStream('unicorn.png'));
//=> true
isStream({});
//=> falseAPI
isStream(stream)
Returns a boolean for whether it's a Stream.
isWritableStream(stream)
Returns a boolean for whether it's a stream.Writable.
isReadableStream(stream)
Returns a boolean for whether it's a stream.Readable.
isDuplexStream(stream)
Returns a boolean for whether it's a stream.Duplex.
isTransformStream(stream)
Returns a boolean for whether it's a stream.Transform.
Related
- is-file-stream - Detect if a stream is a file stream
cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/is-stream
