class ConcatenatedJsonParseStream
implements TransformStream<string, JsonValue>
Stream to parse Concatenated JSON.
Examples
Example 1
Example 1
import { ConcatenatedJsonParseStream } from "@std/json/concatenated_json_parse_stream"; const url = "@std/json/testdata/test.concatenated-json"; const { body } = await fetch(url); const readable = body! .pipeThrough(new TextDecoderStream()) // convert Uint8Array to string .pipeThrough(new ConcatenatedJsonParseStream()); // parse Concatenated JSON for await (const data of readable) { console.log(data); }
Constructors
new ConcatenatedJsonParseStream(unnamed 0?: ParseStreamOptions)Constructs a new instance.
Properties
readonly
readable: ReadableStream<JsonValue>A readable stream of byte data.
readonly
writable: WritableStream<string>A writable stream of byte data.