This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
TripSit_Suite/node_modules/is-stream
cranberry ed23347e56 Initial comission of TheLounge base files 2020-11-01 22:46:04 +00:00
..
index.d.ts Initial comission of TheLounge base files 2020-11-01 22:46:04 +00:00
index.js Initial comission of TheLounge base files 2020-11-01 22:46:04 +00:00
license Initial comission of TheLounge base files 2020-11-01 22:46:04 +00:00
package.json Initial comission of TheLounge base files 2020-11-01 22:46:04 +00:00
readme.md Initial comission of TheLounge base files 2020-11-01 22:46:04 +00:00

readme.md

is-stream Build Status

Check if something is a Node.js stream

Install

$ npm install is-stream

Usage

const fs = require('fs');
const isStream = require('is-stream');

isStream(fs.createReadStream('unicorn.png'));
//=> true

isStream({});
//=> false

API

isStream(stream)

Returns a boolean for whether its a Stream.

isStream.writable(stream)

Returns a boolean for whether its a stream.Writable.

isStream.readable(stream)

Returns a boolean for whether its a stream.Readable.

isStream.duplex(stream)

Returns a boolean for whether its a stream.Duplex.

isStream.transform(stream)

Returns a boolean for whether its a stream.Transform.

License

MIT © Sindre Sorhus