Skip to main content
Go to Latest
class ConcatenatedJSONParseStream
implements TransformStream<string, JSONValue>
import { ConcatenatedJSONParseStream } from "https://deno.land/std@0.152.0/encoding/json/stream.ts";

stream to parse Concatenated JSON.

import { ConcatenatedJSONParseStream } from "https://deno.land/std@0.152.0/encoding/json/stream.ts";

const url = "https://deno.land/std@0.152.0/encoding/testdata/json/test.concatenated-json";
const { body } = await fetch(url);

const readable = body!
  .pipeThrough(new TextDecoderStream())
  .pipeThrough(new ConcatenatedJSONParseStream());

for await (const data of readable) {
  console.log(data);
}

Constructors

new
ConcatenatedJSONParseStream(unnamed 0?: ParseStreamOptions)

Properties

readonly
readable: ReadableStream<JSONValue>
readonly
writable: WritableStream<string>