web-stream-kit
    Preparing search index...

    Class JsonParseStream<T>

    A TransformStream that buffers incoming text chunks and parses the entire stream as a single JSON entity on completion.

    const dataStream = response.body
    .pipeThrough(new TextDecoderStream())
    .pipeThrough(new JsonParseStream<UserProfile>());

    Type Parameters

    • T = unknown

      The expected shape of the parsed JSON root.

    Hierarchy

    • TransformStream<string, T>
      • JsonParseStream
    Index
    • Constructs a new JsonParseStream.

      Type Parameters

      • T = unknown

        The expected shape of the parsed JSON root.

      Parameters

      Returns JsonParseStream<T>

    readable: ReadableStream<T>

    The readable read-only property of the TransformStream interface returns the ReadableStream instance controlled by this TransformStream.

    MDN Reference

    writable: WritableStream<string>

    The writable read-only property of the TransformStream interface returns the WritableStream instance controlled by this TransformStream.

    MDN Reference