How to use the isstream.isDuplex function in isstream

To help you get started, we’ve selected a few isstream examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mappum / peer-exchange / src / peer.js View on Github external
constructor (socket, networks, connectInfo) {
    if (!isDuplex(socket)) {
      throw new Error('socket must be a duplex stream')
    }
    super()

    this.error = this.error.bind(this)

    this.connectInfo = connectInfo
    this.networks = networks
    this.candidates = {}
    this.closed = false
    this.ready = false
    this.connected = {}
    this.remoteNetworks = null
    this.remoteConnectInfo = null

    this.socket = socket

isstream

Determine if an object is a Stream

MIT
Latest version published 9 years ago

Package Health Score

67 / 100
Full package analysis