is-stream (2.0.1)

Published 2026-02-24 13:58:40 +00:00 by atheaadmin

Installation

registry=
npm install is-stream@2.0.1
"is-stream": "2.0.1"

About this package

is-stream

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 it's a Stream.

isStream.writable(stream)

Returns a boolean for whether it's a stream.Writable.

isStream.readable(stream)

Returns a boolean for whether it's a stream.Readable.

isStream.duplex(stream)

Returns a boolean for whether it's a stream.Duplex.

isStream.transform(stream)

Returns a boolean for whether it's a stream.Transform.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Dependencies

Development Dependencies

ID Version
@types/node ^11.13.6
ava ^1.4.1
tempy ^0.3.0
tsd ^0.7.2
xo ^0.24.0

Keywords

stream type streams writable readable duplex transform check detect is
Details
npm
2026-02-24 13:58:40 +00:00
1
Sindre Sorhus
MIT
latest
2.2 KiB
Assets (1)
Versions (1) View all
2.0.1 2026-02-24