Strictly and correctly checks if value is a nodejs stream.
npm i is-node-stream --save
For more use-cases see the tests
var stream = require('stream')
var isNodeStream = require('is-node-stream')
isNodeStream(new stream.Stream())
isNodeStream(new stream.Duplex())
isNodeStream(new stream.Readable())
isNodeStream(new stream.Writable())
isNodeStream(new stream.Transform())
isNodeStream(new stream.PassThrough())
isNodeStream(new net.Socket())
isNodeStream(fs.createReadStream('package.json'))
isNodeStream.readable(process.stdin)
isNodeStream.readable(new stream.Duplex())
isNodeStream.readable(new stream.Readable())
isNodeStream.readable(new stream.Transform())
isNodeStream.readable(new stream.PassThrough())
isNodeStream.readable(fs.createReadStream('package.json'))
isNodeStream.writable(process.stdout)
isNodeStream.writable(new stream.Duplex())
isNodeStream.writable(new stream.Writable())
isNodeStream.writable(new stream.Transform())
isNodeStream.writable(new stream.PassThrough())
isNodeStream.writable(fs.createWriteStream('foobar'))
isNodeStream.duplex(new stream.Duplex())
isNodeStream.duplex(new stream.Transform())
isNodeStream.duplex(new stream.PassThrough())
- dush: Minimalist 1.5kb event delegation for the browser (IE8+) and nodejs.
- is-emitter: Check that given value is EventEmitter, not so strict as
is-node-emitter
. - is-node-emitter: Strictly checks that given value is nodejs EventEmitter… more
- is-stream: Check if something is a Node.js stream
- to-emitter: Convert any object into an event-emitter, and emits events with the… more
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.