Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/levo/lib/lib.deno_runtime.d.ts>Deno.writeTextFileSync

Server side rendering with The Elm Architecture in Deno
Latest
function Deno.writeTextFileSync
import { Deno } from "https://deno.land/x/levo@v0.0.27/lib/lib.deno_runtime.d.ts";
const { writeTextFileSync } = Deno;

Synchronously write string data to the given path, by default creating a new file if needed, else overwriting.

await Deno.writeTextFileSync("hello1.txt", "Hello world\n");  // overwrite "hello1.txt" or create it

Requires allow-write permission, and allow-read if options.create is false.

Parameters

path: string | URL
data: string
optional
options: WriteFileOptions