|                                                                  |  | # isStream
[](http://travis-ci.org/rvagg/isstream)
**Test if an object is a `Stream`**
[](https://nodei.co/npm/isstream/)
The missing `Stream.isStream(obj)`: determine if an object is standard Node.js `Stream`. Works for Node-core `Stream` objects (for 0.8, 0.10, 0.11, and in theory, older and newer versions) and all versions of **[readable-stream](https://github.com/isaacs/readable-stream)**.
## Usage:
```jsvar isStream = require('isstream')var Stream = require('stream')
isStream(new Stream()) // true
isStream({}) // false
isStream(new Stream.Readable())    // trueisStream(new Stream.Writable())    // trueisStream(new Stream.Duplex())      // trueisStream(new Stream.Transform())   // trueisStream(new Stream.PassThrough()) // true```
## But wait! There's more!
You can also test for `isReadable(obj)`, `isWritable(obj)` and `isDuplex(obj)` to test for implementations of Streams2 (and Streams3) base classes.
```jsvar isReadable = require('isstream').isReadablevar isWritable = require('isstream').isWritablevar isDuplex = require('isstream').isDuplexvar Stream = require('stream')
isReadable(new Stream()) // falseisWritable(new Stream()) // falseisDuplex(new Stream())   // false
isReadable(new Stream.Readable())    // trueisReadable(new Stream.Writable())    // falseisReadable(new Stream.Duplex())      // trueisReadable(new Stream.Transform())   // trueisReadable(new Stream.PassThrough()) // true
isWritable(new Stream.Readable())    // falseisWritable(new Stream.Writable())    // trueisWritable(new Stream.Duplex())      // trueisWritable(new Stream.Transform())   // trueisWritable(new Stream.PassThrough()) // true
isDuplex(new Stream.Readable())    // falseisDuplex(new Stream.Writable())    // falseisDuplex(new Stream.Duplex())      // trueisDuplex(new Stream.Transform())   // trueisDuplex(new Stream.PassThrough()) // true```
*Reminder: when implementing your own streams, please [use **readable-stream** rather than core streams](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).*
## License
**isStream** is Copyright (c) 2015 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.
 |