How to use the readable-stream.PassThrough.call function in readable-stream

To help you get started, we’ve selected a few readable-stream 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 seven1986 / oauthapp / IdentityServer4.MicroService.Host / node_modules / cloneable-readable / index.js View on Github external
function Clone (parent, opts) {
  if (!(this instanceof Clone)) {
    return new Clone(parent, opts)
  }

  var objectMode = parent._readableState.objectMode

  opts = opts || {}
  opts.objectMode = objectMode

  this.parent = parent

  PassThrough.call(this, opts)

  forwardDestroy(parent, this)

  parent.pipe(this)

  // the events added by the clone should not count
  // for starting the flow
  // so we add the newListener handle after we are done
  this.on('newListener', onDataClone)
  this.on('resume', onResumeClone)
}
github watson / ipp-printer / lib / job.js View on Github external
function Job (printer, req) {
  PassThrough.call(this)

  var attributes = utils.getAttributesForGroup(req._body, C.OPERATION_ATTRIBUTES_TAG)
  this.compression = utils.getFirstValueForName(attributes, 'compression')

  this._printer = printer
  this._req = req

  this.id = ++printer._jobId
  this.state = C.JOB_PENDING
  this.uri = printer.uri + this.id
  this.name = utils.getFirstValueForName(attributes, 'job-name')
  this.userName = utils.getFirstValueForName(attributes, 'requesting-user-name')
  this.createdAt = new Date()

  printer.add(this)
}
github seven1986 / oauthapp / IdentityServer4.MicroService.Host / node_modules / cloneable-readable / index.js View on Github external
function Cloneable (stream, opts) {
  if (!(this instanceof Cloneable)) {
    return new Cloneable(stream, opts)
  }

  var objectMode = stream._readableState.objectMode
  this._original = stream
  this._clonesCount = 1

  opts = opts || {}
  opts.objectMode = objectMode

  PassThrough.call(this, opts)

  forwardDestroy(stream, this)

  this.on('newListener', onData)
  this.once('resume', onResume)

  this._hasListener = true
}
github sx1989827 / DOClever / Desktop / node_modules / tar-stream / extract.js View on Github external
var Source = function (self, offset) {
  this._parent = self
  this.offset = offset
  PassThrough.call(this)
}
github devinhalladay / devinhalladay.com / node_modules / tar-stream / extract.js View on Github external
var Source = function (self, offset) {
  this._parent = self
  this.offset = offset
  PassThrough.call(this)
}
github mcollina / cloneable-readable / index.js View on Github external
function Cloneable (stream, opts) {
  if (!(this instanceof Cloneable)) {
    return new Cloneable(stream, opts)
  }

  var objectMode = stream._readableState.objectMode
  this._original = stream
  this._clonesCount = 1

  opts = opts || {}
  opts.objectMode = objectMode

  PassThrough.call(this, opts)

  forwardDestroy(stream, this)

  this.on('newListener', onData)
  this.once('resume', onResume)

  this._hasListener = true
}
github GraftJS / graft / lib / channels.js View on Github external
function GenericWriteChannel() {
  if (!(this instanceof GenericWriteChannel)) {
    return new GenericWriteChannel();
  }
  PassThrough.call(this, { objectMode: true, highWaterMark: 16 });
}
github GraftJS / graft / lib / channels.js View on Github external
function GenericReadChannel() {
  if (!(this instanceof GenericReadChannel)) {
    return new GenericReadChannel();
  }
  PassThrough.call(this, { objectMode: true, highWaterMark: 16 });
}
github sx1989827 / DOClever / node_modules / tar-stream / extract.js View on Github external
var Source = function (self, offset) {
  this._parent = self
  this.offset = offset
  PassThrough.call(this)
}
github mafintosh / tar-stream / extract.js View on Github external
var Source = function (self, offset) {
  this._parent = self
  this.offset = offset
  PassThrough.call(this)
}