Skip to main content
promises.appendFile - fs - Node documentation
function promises.appendFile

Usage in Deno

import { promises } from "node:fs";
appendFile(
data: string | Uint8Array,
options?:
(
ObjectEncodingOptions
& FlagAndOpenMode
& { flush?: boolean | undefined; }
)

| BufferEncoding
| null
,
): Promise<void>

Asynchronously append data to a file, creating the file if it does not yet exist. data can be a string or a Buffer.

If options is a string, then it specifies the encoding.

The mode option only affects the newly created file. See fs.open() for more details.

The path may be specified as a FileHandle that has been opened for appending (using fsPromises.open()).

Parameters

filename or {FileHandle}

data: string | Uint8Array
optional
options:
(
ObjectEncodingOptions
& FlagAndOpenMode
& { flush?: boolean | undefined; }
)

| BufferEncoding
| null

Return Type

Promise<void>

Fulfills with undefined upon success.

Back to top