Genotype API Documentation - v0.1.0
    Preparing search index...

    Function readLines

    • Convert ReadableStream to async iterable of lines

      Handles line buffering properly to ensure complete lines are yielded even when chunks don't align with line boundaries.

      Parameters

      • stream: ReadableStream<Uint8Array<ArrayBufferLike>>

        Stream of binary data to process

      • encoding: "utf8" | "binary" | "ascii" = "utf8"

        Text encoding to use (default: 'utf8')

      Returns AsyncIterable<string>

      Complete lines of text

      If stream processing fails

      If line is too long or buffer overflow occurs

      const stream = await createStream('/path/to/genome.fasta');
      for await (const line of readLines(stream)) {
      if (line.startsWith('>')) {
      console.log('Found header:', line);
      }
      }