Skip to content
Tauri

readTextFileLines

readTextFileLines(path, options?): Promise<AsyncIterableIterator<string, any, any>>

Defined in: plugins/fs/guest-js/index.ts:798

Returns an async AsyncIterableIterator over the lines of a file as UTF-8 string.

string | URL

ReadFileOptions

Promise<AsyncIterableIterator<string, any, any>>

import { 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.

2.0.0


© 2025 Tauri Contributors. CC-BY / MIT