$ gnpm install is-stream
Check if something is a Node.js stream
$ npm install is-stream
import fs from 'node:fs';
import {isStream} from 'is-stream';
isStream(fs.createReadStream('unicorn.png'));
//=> true
isStream({});
//=> false
Returns a boolean for whether it's a Stream.
Returns a boolean for whether it's a stream.Writable.
Returns a boolean for whether it's a stream.Readable.
Returns a boolean for whether it's a stream.Duplex.
Returns a boolean for whether it's a stream.Transform.
Copyright 2013 - present © cnpmjs.org | Home |