Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/adka/deno.d.ts>Deno.writeTextFileSync

SSG & SSR: Static site generator and server side rendering using JSX.
Latest
function Deno.writeTextFileSync
import { Deno } from "https://deno.land/x/adka@0.1.5/deno.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