2024-01-01 21:11:32 +00:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-03-24 03:07:30 +00:00
|
|
|
|
2024-06-18 10:10:57 +00:00
|
|
|
/**
|
|
|
|
* Utilities for parsing streaming JSON data.
|
|
|
|
*
|
|
|
|
* ```ts
|
|
|
|
* import { JsonStringifyStream } from "@std/json";
|
refactor(assert,async,bytes,cli,collections,crypto,csv,data-structures,datetime,dotenv,encoding,expect,fmt,front-matter,fs,html,http,ini,internal,io,json,jsonc,log,media-types,msgpack,net,path,semver,streams,testing,text,toml,ulid,url,uuid,webgpu,yaml): import from `@std/assert` (#5199)
* refactor: import from `@std/assert`
* update
2024-06-30 08:30:10 +00:00
|
|
|
* import { assertEquals } from "@std/assert";
|
2024-06-18 10:10:57 +00:00
|
|
|
*
|
|
|
|
* const stream = ReadableStream.from([{ foo: "bar" }, { baz: 100 }])
|
|
|
|
* .pipeThrough(new JsonStringifyStream());
|
|
|
|
*
|
|
|
|
* assertEquals(await Array.fromAsync(stream), [
|
|
|
|
* `{"foo":"bar"}\n`,
|
|
|
|
* `{"baz":100}\n`
|
|
|
|
* ]);
|
|
|
|
* ```
|
2023-03-24 03:07:30 +00:00
|
|
|
*
|
|
|
|
* @module
|
|
|
|
*/
|
|
|
|
|
2023-03-13 05:56:53 +00:00
|
|
|
export * from "./concatenated_json_parse_stream.ts";
|
2024-06-21 05:56:11 +00:00
|
|
|
export * from "./types.ts";
|
2024-07-02 01:57:00 +00:00
|
|
|
export * from "./parse_stream.ts";
|
|
|
|
export * from "./stringify_stream.ts";
|