var stream = require('stream') function isStream (obj) { return obj instanceof stream.Stream } function isReadable (obj) { return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object' } function isWritable (obj) { return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object' } function isDuplex (obj) { return isReadable(obj) && isWritable(obj) } module.exports = isStream module.exports.isReadable = isReadable module.exports.isWritable = isWritable module.exports.isDuplex = isDuplex
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
.npmignore | File | 6 B | 0644 |
|
.travis.yml | File | 150 B | 0644 |
|
LICENSE.md | File | 1.1 KB | 0644 |
|
README.md | File | 2.37 KB | 0644 |
|
isstream.js | File | 588 B | 0644 |
|
package.json | File | 1.62 KB | 0644 |
|
test.js | File | 6.81 KB | 0644 |
|