W3cubDocs

/Deno

Deno.WriteFileOptions

Options for writing to a file.

interface WriteFileOptions {
append?: boolean;
create?: boolean;
mode?: number;
signal?: AbortSignal;
}

Properties

append?: boolean

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

create?: boolean

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

mode?: number

Permissions always applied to file.

signal?: AbortSignal

An abort signal to allow cancellation of the file write operation. If the signal becomes aborted the writeFile operation will be stopped and the promise returned will be rejected with an AbortError.