Class JsonStringifyStream
Hierarchy
- TransformStream<unknown, string>
- JsonStringifyStream
Index
Constructors
Properties
Constructors
constructor
- new
Json (options?): JsonStringifyStreamStringify Stream Constructs new instance.
Parameters
Optionaloptions: StringifyStreamOptionsOptions for the stream.
Returns JsonStringifyStream
Convert each chunk to JSON string.
This can be used to stringify JSON lines, NDJSON, JSON Text Sequences, and Concatenated JSON.
You can optionally specify a prefix and suffix for each chunk. The default prefix is
""and the default suffix is"\n".Example: Basic usage
Example: Stringify stream of JSON text sequences
Set
options.prefixto\x1Eto stringifyJSON Text Sequences.Example: Stringify JSON lines from a server