• Reads a file line by line and calls the given function for each line. The lineNumber starts at 0. The maxLines option limits the maximum number of read lines and is Infinity by default.

    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.