How to use the emit function from readable-stream

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

2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
    activeDecodedStream = null;
    retries = 0;
    let inc = opts.backoff.inc;
    let ms = Math.min(inc, opts.backoff.max);
    retryTimeout = setTimeout(doDownload, ms);
    stream.emit('reconnect', reconnects, err);
};
const reconnectIfEndedEarly = (err) => {
    if (options.method !== 'HEAD' && !downloadComplete() && reconnects++ < opts.maxReconnects) {
        reconnect(err);
fork icon2
star icon3
watch icon1

+ 23 other calls in file

3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
  chunk = _uint8ArrayToBuffer(chunk);
}

if (addToFront) {
  if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
} else if (state.ended) {
  stream.emit('error', new Error('stream.push() after EOF'));
} else {
  state.reading = false;
fork icon0
star icon0
watch icon0

+ 50 other calls in file