UNPKG

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