Function readlines

  • An extremely fast JavaScript native (bun) line reader for use with arbitrary files. This is included as a utility for manual data pre-processing.

    Example

    for await (let line of sm.io.readlines('myfile.txt')) {
    console.log(line.split(',')[0])
    }

    Returns

    A generator of each line in the file

    Parameters

    • filename: string

      The file to open and asynchronously read from

    • utfLabel: Encoding = 'utf-8'

      The label of the encoder

    • buffer_len: number = 16

      The size of the buffer to read into before flushing to the user

    Returns AsyncGenerator<any, void, unknown>

Generated using TypeDoc