Skip to main content
On this page

@std/json

Overview Jump to heading

Utilities for parsing streaming JSON data.

import { JsonStringifyStream } from "@std/json";
import { assertEquals } from "@std/assert";

const stream = ReadableStream.from([{ foo: "bar" }, { baz: 100 }])
  .pipeThrough(new JsonStringifyStream());

assertEquals(await Array.fromAsync(stream), [
  `{"foo":"bar"}\n`,
  `{"baz":100}\n`
]);

Add to your project Jump to heading

deno add jsr:@std/json

See all symbols in @std/json on

Did you find what you needed?

Privacy policy