Parameters
- filePath: string
- onLine: (line: Buffer, lineNumber: number) => Promise<void>
- maxLines: number = Infinity
Returns Promise<boolean>
Whether all lines have been successfully read (false
if maxLines
was reached)
See readLineByLineSync for a synchronous version.
Reads a file line by line and calls the given function for each line. The
lineNumber
starts at0
. ThemaxLines
option limits the maximum number of read lines and isInfinity
by default.