How to use the readable-stream.Duplex.prototype 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 gameclosure / devkit-core / src / build / util / stream-wrap.js View on Github external
var onEnd = function () {
    this.push(null);
  }.bind(this);

  this.on('finish', function () {
    this._firstStream.end();
  });

  this.once('pipe', function () {
    this._lastStream.on('data', onData);
    this._lastStream.on('end', onEnd);
  }.bind(this));
};

WrapStreams.prototype = Object.create(Duplex.prototype);

WrapStreams.prototype.wrap = function (stream) {
  if (!this._firstStream) {
    this._firstStream = stream;
    this._lastStream = stream;
  } else {
    this._lastStream = this._lastStream.pipe(stream);
  }

  stream.on('error', function (err) {
    this.emit('error', err);
  }.bind(this));

  return this;
};
github browserify / stream-splicer / index.js View on Github external
stream.once('end', function () {
        var ix = self._streams.indexOf(stream);
        if (ix >= 0 && ix === self._streams.length - 1) {
            Duplex.prototype.push.call(self, null);
        }
    });
    this._streams.push(stream);
github rapp-project / rapp-platform / rapp_ric / hop_services / samples / httpPost_toHopService / node_modules / request / node_modules / bl / bl.js View on Github external
BufferList.prototype.end = function (chunk) {
  DuplexStream.prototype.end.call(this, chunk)

  if (this._callback) {
    this._callback(null, this.slice())
    this._callback = null
  }
}
github mateogianolio / scrabbler / node_modules / level / node_modules / level-packager / node_modules / levelup / node_modules / bl / bl.js View on Github external
BufferList.prototype.end = function (chunk) {
  DuplexStream.prototype.end.call(this, chunk)

  if (this._callback) {
    this._callback(null, this.slice())
    this._callback = null
  }
}
github rvagg / list-stream / list-stream.js View on Github external
ListStream.prototype.end = function (chunk) {
  DuplexStream.prototype.end.call(this, chunk)

  if (this._callback) {
    this._callback(null, this._chunks)
    this._callback = null
  }
}
github azproduction / lmd / lib / data_stream.js View on Github external
DataStream.prototype.end = function () {
    Duplex.prototype.end.apply(this, arguments);
    this._finished = true;
    this._push();
};
github rvagg / bl / bl.js View on Github external
BufferListStream.prototype.end = function end (chunk) {
  DuplexStream.prototype.end.call(this, chunk)

  if (this._callback) {
    this._callback(null, this.slice())
    this._callback = null
  }
}
github rdmtc / RedMatic / prebuilt / armv6l / lib / node_modules / node-red-contrib-johnny-five / node_modules / bl / bl.js View on Github external
BufferList.prototype.end = function end (chunk) {
  DuplexStream.prototype.end.call(this, chunk)

  if (this._callback) {
    this._callback(null, this.slice())
    this._callback = null
  }
}