• Converts a ReadableStream into a callback pattern.

    Parameters

    • stream: ReadableStream<Uint8Array>

      The input ReadableStream.

    • onChunk: ((arr, flush?) => void)

      A function that will be called on each new byte chunk in the stream.

        • (arr, flush?): void
        • Parameters

          • arr: Uint8Array
          • Optional flush: boolean

          Returns void

    Returns Promise<void>

    A promise that will be resolved when the stream closes.

Generated using TypeDoc