UNPKG

iterparse

Version:
41 lines 1.62 kB
import { ProgressReportOptions, WriteProgressReportOptions } from './helpers'; import { AnyIterable, FileReference, FileWriteMode, IX } from './types'; export interface LineReadOptions extends ProgressReportOptions, FileReference { lineBreak?: string; } export declare function _lineIterParser(options: LineReadOptions): AsyncGenerator<string, void, unknown>; /** * Function will read file line by line * @param options - optional options list. * @include ./LineReadOptions.md * @example * import { lineRead } from 'iterparse' * lineRead({ filePath: "path/to/file" }) * .map((q)=> console.log(q)) * .count() * @example * import { lineRead } from 'iterparse' * for await (const line of lineRead({ filePath: "path/to/file" })) { * * } * @category Line */ export declare function lineRead(options: LineReadOptions): IX<string>; export interface LineWriteOptions extends FileReference, FileWriteMode, WriteProgressReportOptions { } /** * Function will write iteratable in memory efficient way. * @include ./LineWriteOptions.md * @example * import { AsyncIterable } from 'ix' * import { lineWrite } from 'iterparse' * AsyncIterable.from(["1", "2", "3", "4", "5"]) * .pipe(lineWrite({ filePath: "path/to/file" })) * .count() * @example * lineWrite(["1", "2", "3", "4", "5"], { filePath: "path/to/file" }).count() * @category Line */ export declare function lineWrite(args: LineWriteOptions): (data: AnyIterable<string>) => IX<string>; export declare function lineWrite(data: AnyIterable<string>, args: LineWriteOptions): IX<string>; //# sourceMappingURL=line.d.ts.map