UNPKG

668 BTypeScriptView Raw
1import { TransformTyped } from '../stream.model';
2export interface TransformToNDJsonOptions {
3 /**
4 * @default true
5 * If true - will throw an error on JSON.parse / stringify error
6 */
7 strict?: boolean;
8 /**
9 * @default false
10 * If true - will run `sortObjectDeep()` on each object to achieve deterministic sort
11 */
12 sortObjects?: boolean;
13 /**
14 * @default `\n`
15 */
16 separator?: string;
17}
18/**
19 * Transforms objects (objectMode=true) into chunks \n-terminated JSON strings (readableObjectMode=false).
20 */
21export declare function transformToNDJson<IN = any>(opt?: TransformToNDJsonOptions): TransformTyped<IN, string>;