Documentation
    Preparing search index...

    Function timeout

    • Makes sure that events are emitted within ms. Otherwise emits an error.

      Type Parameters

      • T

      Parameters

      • ms: number

      Returns TransformStream<T, T>

      readableStream
      .pipeThrough(timeout(1_000))
      .pipeTo(write())
      .catch(error => {
      // error is TimeoutError if any event took too long
      })