import { toJson } from "https://deno.land/x/fathym_eac_runtime@v0.0.140/src/src.deps.ts";
Converts a JSON-formatted ReadableSteam
of strings or
Uint8Array
s to an object. Works the same as
Response.json
.
Examples
Example 1
Example 1
import { toJson } from "https://deno.land/std@0.224.0/streams/to_json.ts";
const stream = ReadableStream.from([JSON.stringify({ hello: "world" })]);
await toJson(stream); // { hello: "world" }
Parameters
readableStream: ReadableStream