Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deno/cli/tsc/dts/lib.deno.ns.d.ts>Deno.WriteFileOptions

A modern runtime for JavaScript and TypeScript.
Go to Latest
interface Deno.WriteFileOptions
import { type Deno } from "https://deno.land/x/deno@v1.30.0/cli/tsc/dts/lib.deno.ns.d.ts";
const { WriteFileOptions } = Deno;

Options for writing to a file.

Properties

optional
append: boolean

If set to true, will append to a file instead of overwriting previous contents.

optional
create: boolean = true

Sets the option to allow creating a new file, if one doesn't already exist at the specified path.

optional
createNew: boolean

If set to true, no file, directory, or symlink is allowed to exist at the target location. When createNew is set to true, create is ignored.

optional
mode: number

Permissions always applied to file.

optional
signal: AbortSignal

An abort signal to allow cancellation of the file write operation.

If the signal becomes aborted the write file operation will be stopped and the promise returned will be rejected with an AbortError.