Skip to content

tunnckoCore/is-request-stream

Repository files navigation

Check that given value is request stream

code climate standard code style travis build status cov status dependency status

Install

npm i is-request-stream --save

Usage

For more use-cases see the tests

var net = require('net')
var http = require('http')
var stream = require('stream')
var isRequestStream = require('is-request-stream')

var req = http.get('http://www.tunnckocore.tk')

isRequestStream(req) //=> true
isRequestStream(new net.Socket()) //=> false
isRequestStream(new stream.Readable()) //=> false
isRequestStream(new stream.Writable()) //=> false
isRequestStream(new stream.Transform()) //=> false
isRequestStream(new stream.Duplex()) //=> false

Related

  • is-async-function: Check that given function is async (callback) function or not. Trying to… more
  • is-child-process: Checks whether a value is child process result, which in case… more
  • is-emitter: Check that given value is EventEmitter, not so strict as is-node-emitter.
  • is-kindof: Check type of given javascript value. Support promises, generators, streams,… more
  • is-missing: Check that given name or user/repo exists in npm registry or in github as user… more
  • is-node-emitter: Strictly checks that given value is nodejs EventEmitter. It's easy, because… more
  • is-node-stream: Strictly and correctly checks if value is a nodejs stream.
  • is-typeof-error: Check that given value is any type of error and instanceof Error

Contributing

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.

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github