index.js
function unpipe (stream) {
  if (!stream) {
    throw new TypeError('argument stream is required')
  }

  if (typeof stream.unpipe === 'function') {
    // new-style
    stream.unpipe()
    return
  }

  // Node.js 0.8 hack
  if (!hasPipeDataListeners(stream)) {
    return
  }

  var listener
  var listeners = stream.listeners('close')

  for (var i = 0; i < listeners.length; i++) {
    listener = listeners[i]

    if (listener.name !== 'cleanup' && listener.name !== 'onclose') {
      continue
    }

    // invoke the listener
    listener.call(stream)
  }
}
function unpipe (stream) {
  if (!stream) {
    throw new TypeError('argument stream is required')
  }

  if (typeof stream.unpipe === 'function') {
    // new-style
    stream.unpipe()
    return
  }

  // Node.js 0.8 hack
  if (!hasPipeDataListeners(stream)) {
    return
  }

  var listener
  var listeners = stream.listeners('close')

  for (var i = 0; i < listeners.length; i++) {
    listener = listeners[i]

    if (listener.name !== 'cleanup' && listener.name !== 'onclose') {
      continue
    }

    // invoke the listener
    listener.call(stream)
  }
}
function unpipe ( stream ) { if ( ! stream ) { throw new TypeError ( 'argument stream is required' ) } if ( typeof stream . unpipe === 'function' ) { // new-style stream . unpipe ( ) return } // Node.js 0.8 hack if ( ! hasPipeDataListeners ( stream ) ) { return } var listener var listeners = stream . listeners ( 'close' ) for ( var i = 0 ; i < listeners . length ; i ++ ) { listener = listeners [ i ] if ( listener . name !== 'cleanup' && listener . name !== 'onclose' ) { continue } // invoke the listener listener . call ( stream ) } }
Unpipe a stream from all destinations.

@param {object} stream
@public
Unpipe a stream from all destinations .