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.
Stream of binary data to process
Text encoding to use (default: 'utf8')
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); }} Copy
const stream = await createStream('/path/to/genome.fasta');for await (const line of readLines(stream)) { if (line.startsWith('>')) { console.log('Found header:', line); }}
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.