UNPKG

824 BTypeScriptView Raw
1import { AbortableAsyncMapper } from '@naturalcycles/js-lib';
2import { TransformMapOptions, TransformLogProgressOptions } from '../..';
3export interface NDJSONMapOptions<IN = any, OUT = IN> extends TransformMapOptions<IN, OUT>, TransformLogProgressOptions<IN> {
4 inputFilePath: string;
5 outputFilePath: string;
6 limitInput?: number;
7 limitOutput?: number;
8 /**
9 * @default 100_000
10 */
11 logEveryOutput?: number;
12 /**
13 * Defaults to `true` for ndjsonMap
14 *
15 * @default true
16 */
17 flattenArrayOutput?: boolean;
18}
19/**
20 * Unzips input file automatically, if it ends with `.gz`.
21 * Zips output file automatically, if it ends with `.gz`.
22 */
23export declare function ndjsonMap<IN = any, OUT = any>(mapper: AbortableAsyncMapper<IN, OUT>, opt: NDJSONMapOptions<IN, OUT>): Promise<void>;