Utility class for readable data stream, intentionally named to disambiguate from ReadableStream, readable-stream, Readable etc.

Constructors

Methods

  • Duplicates the given data stream into the number of streams specified so that multiple handlers can consume the same data stream.

    Parameters

    • dataStream: Readable
    • count: number

    Returns Readable[]

  • Creates a readable stream from the bytes given.

    Parameters

    • bytes: Uint8Array

    Returns Readable

  • Creates a readable stream from the object given.

    Parameters

    • object: Record<string, any>

    Returns Readable

  • Reads the entire readable stream given into array of bytes.

    Parameters

    • readableStream: Readable

    Returns Promise<Uint8Array>

  • Reads the entire readable stream and JSON parses it into an object.

    Parameters

    • readableStream: Readable

    Returns Promise<object>