4.0.1 • Published 2 months ago

is-stream v4.0.1

Weekly downloads
35,088,504
License
MIT
Repository
github
Last release
2 months ago

is-stream

Check if something is a Node.js stream

Install

npm install is-stream

Usage

import fs from 'node:fs';
import {isStream} from 'is-stream';

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

isStream({});
//=> false

API

isStream(stream, options?)

Returns a boolean for whether it's a Stream.

isWritableStream(stream, options?)

Returns a boolean for whether it's a stream.Writable, an http.OutgoingMessage, an http.ServerResponse or an http.ClientRequest.

isReadableStream(stream, options?)

Returns a boolean for whether it's a stream.Readable or an http.IncomingMessage.

isDuplexStream(stream, options?)

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

isTransformStream(stream, options?)

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

Options

checkOpen

Type: boolean\ Default: true

When this option is true, the method returns false if the stream has already been closed.

Related

get-streamexecadecompress-tarbz2decompress-targzdecompress-tarwinstonlistrgaxiosarchiver-utilshashacompress-commonstempylernatemp-write@lerna/createfree-mincuc-gaf@allie-project/listrarchetype-librarycapi-sdk-nodejs-commoncomponennentt@tomtoms/capi-nodejs-sdkeasy-select-rn@lilpacy/torus-embed@saasxx/mvcvuedragdropuploadimagesterminal-api-lib-itay-testreact-native-bluetooth2killi8n-react-native-fast-image@darrinholst/cucumberrn-send-smsspecify-importsbabel-specify-importskinston@icanpm/api-master@arisageha/react-lazyload@arisageha/react-lazyload-fixfoshata-markdownmarkdownproofreader@cashremit/cr-streamline-iconscc-imagemin-pngquantreact-native-template-rfbasetencentcloud-sdk-nodejs-common1airscanairscan-examplerabaz-tempreadytest-testcafebb-chatreact-native-esc-pos-sahaab@sgpinkus/mailgun-js@borisovart/atol-kkt-moduleipfs-cluster-uploader@frxf/frxfdeneme323112@texttree/demo-bsa-reference-rcl@piyushmishra/structured-data-testing-tool@fundefund/funde_ck@ntt_app/react-native-custom-notificationreact-native-custom-text-hwjamesreact-native-covid-sdkgql_din_modbitgetmicro-with-es@tempicolabs/sdkreact-native-thanh-toast-library@jttechnic/interpreter@thanhnguyen14797/react-native-thanh-toast-library@l1nyanm1ng/react-picture-viewercthpb-plugin-socialejz-sova@iobroker-community-adapters/iobroker.device-watcherimagemin-pngquant-es@olivervorasai/sliderbroken-link-checker-timeoutmysql-formatreact-native-printer-brothersrn-pdf-reader-offlinecbmis-ai-toolbox@newhorizon-tech/dd-npm-package-templatereact-native-shekhar-bridge-testcogoportutilsukor-remasterstalky-instagram-modulexml-editdyx-reactffmpeg-test-editing-montages-and-transitionslevibestliblevibestlib2levilibtest19levilibtest24levilibtest25levilibtest26levilibtest27levilibtest28levilibtest29talent-to-vite-cliwilscanner@lalosh/forgiving-bent@oiti/documentoscopy-react-nativegramster
4.0.1

2 months ago

4.0.0

2 months ago

3.0.0

3 years ago

2.0.1

3 years ago

2.0.0

5 years ago

1.1.0

8 years ago

1.0.1

9 years ago

1.0.0

9 years ago