stringify2stream
v1.1.0
Published
A js library to stringify json to stream to avoid out-of-memory of JSON.stringify.
Downloads
486
Readme
stringify2stream
A js library to stringify json to stream to avoid out-of-memory of JSON.stringify.
install
yarn add stringify2stream
usage
import stringify from "stringify2stream";
// <script src="./node_modules/stringify2stream/stringify2stream.min.js"></script>
const writeStream = getWritableStreamSomehow();
stringify({ foo: 123 }, data => writeStream.write(data));
types
export default function stringify(value: any, write: (data: string | undefined) => void, replacer?: ((key: string, value: any) => any) | (number | string)[] | null, space?: string | number): void