import { ConcatenatedJsonParseStream } from "https://deno.land/std@0.171.0/encoding/json/_parse.ts";
stream to parse Concatenated JSON.
Examples
Example 1
Example 1
import { ConcatenatedJsonParseStream } from "https://deno.land/std@0.171.0/encoding/json/stream.ts";
const url = "https://deno.land/std@0.171.0/encoding/testdata/json/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);
}
Properties
readonly
readable: ReadableStream<JsonValue>readonly
writable: WritableStream<string>