writeTextFileSync
import { writeTextFileSync } from "jsr:@ende/fs/unstable-write-text-file";function · experimental · requires --allow-read, --allow-write
function writeTextFileSync(path: string | URL, data: string, options?: WriteFileOptions): voidSynchronously write string data to the given path, by default creating
a new file if needed, else overwriting.
Requires allow-write permission, and allow-read if options.create is
false.
path: string | URLThe path of the file that
datais written to.data: stringA UTF-8 string.
options?: WriteFileOptionsOptions for writing files. See
WriteFileOptions.
Example: Usage
import { writeTextFileSync } from "@ende/fs/unstable-write-text-file";
writeTextFileSync("hello1.txt", "Hello world\n"); // overwrite "hello1.txt" or create it