How to use the prototype function from readable-stream

Find comprehensive JavaScript readable-stream.prototype code examples handpicked from public code repositorys.

38
39
40
41
42
43
44
45
46
    this._receiverCapacity += size;
    this._push();
};

DataStream.prototype.end = function () {
    Duplex.prototype.end.apply(this, arguments);
    this._finished = true;
    this._push();
};
fork icon27
star icon449
watch icon31

44
45
46
47
48
49
50
51
52
53
    if (self.closed) {
        cb(null); // lal
        return false;
    }

    return Writable.prototype.write.call(self, entry, cb);
};

LoggerStream.prototype._write = function write(entry, enc, cb) {
    var self = this;
fork icon20
star icon160
watch icon0

+ 11 other calls in file

56
57
58
59
60
61
62
63
64
65
66
67
  this.push(this.slice(0, size))
  this.consume(size)
}


BufferListStream.prototype.end = function end (chunk) {
  DuplexStream.prototype.end.call(this, chunk)


  if (this._callback) {
    this._callback(null, this.slice())
    this._callback = null
fork icon0
star icon0
watch icon0

57
58
59
60
61
62
63
64
65
66
67
// data has been written to our target stream. So we suppress
// finish from being emitted here, and only emit it after our
// target stream is closed and we've moved everything around.
WriteStreamAtomic.prototype.emit = function (event) {
  if (event === 'finish') return this.__atomicStream.end()
  return Writable.prototype.emit.apply(this, arguments)
}


WriteStreamAtomic.prototype._write = function (buffer, encoding, cb) {
  var flushed = this.__atomicStream.write(buffer, encoding)
fork icon0
star icon0
watch icon0