Deno.writeTextFile

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

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

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

function writeTextFile(
path: string | URL,
data: string,
options?: WriteFileOptions,
): Promise<void>;
§
writeTextFile(path: string | URL, data: string, options?: WriteFileOptions): Promise<void>
[src]

§Parameters

§
path: string | URL
[src]
§
data: string
[src]
§
options?: WriteFileOptions optional
[src]

§Return Type

§
Promise<void>
[src]