Installation
npm install --save @types/line-reader
Summary
This package contains type definitions for line-reader (https://github.com/nickewing/line-reader).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/line-reader.
index.d.ts
/// <reference types="node"/>
interface LineReaderOptions {
separator?: any;
encoding?: string | undefined;
bufferSize?: number | undefined;
}
interface Reader {
hasNextLine(): boolean;
nextLine(cb: (err: Error, line?: string) => void): void;
close(cb: (err: Error) => void): void;
isOpen(): boolean;
isClosed(): boolean;
getReadStream(): NodeJS.ReadableStream;
}
interface LineReader {
open(): Function;
open(
file: string | NodeJS.ReadableStream,
options: LineReaderOptions,
cb: (err: Error, reader: Reader) => void,
): void;
open(file: string | NodeJS.ReadableStream, cb: (err: Error, reader: Reader) => void): void;
eachLine(): Function; // For Promise.promisify;
eachLine(
file: string | NodeJS.ReadableStream,
options: LineReaderOptions,
cb: (line: string, last: boolean, continueCb?: Function) => void,
errCb?: (err?: Error) => void,
): LineReader;
eachLine(
file: string | NodeJS.ReadableStream,
cb: (line: string, last: boolean, continueCb?: Function) => void,
errCb?: (err?: Error) => void,
): LineReader;
}
declare module "line-reader" {
var lr: LineReader;
export = lr;
}
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:38 GMT
- Dependencies: @types/node
Credits
These definitions were written by Sam Saint-Pettersen.