alejandro.alvarez5 70bb213259 articulo | 3 yıl önce | |
---|---|---|
.. | ||
index.d.ts | 3 yıl önce | |
index.js | 3 yıl önce | |
license | 3 yıl önce | |
package.json | 3 yıl önce | |
readme.md | 3 yıl önce |
Check if something is a Node.js stream
$ npm install is-stream
const fs = require('fs');
const isStream = require('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
.