Skip to content

writeTextFile

Module @netwiv/api/plugins/fs · Kind Function

import { writeTextFile } from '@netwiv/api/plugins/fs';

Writes UTF-8 string data to the given path, by default creating a new file if needed, else overwriting.

function writeTextFile(path: string | URL, data: string, options?: WriteFileOptions | undefined): Promise<void>
import { writeTextFile, BaseDirectory } from '@netwiv/api/plugins/fs';
await writeTextFile('file.txt', "Hello world", { baseDir: BaseDirectory.AppLocalData });

Upstream since 2.0.0


Descriptions come from the pinned @tauri-apps/plugin-fs@2.5.2 declarations (MIT OR Apache-2.0); imports are shown with @netwiv/api paths.