Optional
options: ReadFileOptionsimport { readTextFileLines, BaseDirectory } from '@tauri-apps/plugin-fs';
const lines = await readTextFileLines('app.conf', { baseDir: BaseDirectory.AppConfig });
for await (const line of lines) {
console.log(line);
}
You could also call AsyncIterableIterator.next to advance the iterator so you can lazily read the next line whenever you want.
Returns an async AsyncIterableIterator over the lines of a file as UTF-8 string.