## Index

### Interfaces

- FileHandle

### Functions

- access
- appendFile
- chmod
- chown
- copyFile
- fchmod
- fchown
- fdatasync
- fstat
- fsync
- ftruncate
- futimes
- lchmod
- lchown
- link
- lstat
- mkdir
- mkdtemp
- open
- read
- readFile
- readdir
- readlink
- realpath
- rename
- rmdir
- stat
- symlink
- truncate
- unlink
- utimes
- write
- writeFile

## Functions

### access

- access(path: PathLike, mode?: undefined | number): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:1921

  Asynchronously tests a user's permissions for the file specified by path.

  #### Parameters

  - ##### path: PathLike

    A path to a file or directory. If a URL is provided, it must use the `file:` protocol. URL support is experimental.

  - ##### Optional mode: undefined | number

  #### Returns Promise<void>

### appendFile

- appendFile(path: PathLike | FileHandle, data: any, options?: object | string | null): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2243

  Asynchronously append data to a file, creating the file if it does not exist.

  #### Parameters

  - ##### path: PathLike | FileHandle

  - ##### data: any

    The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string.

  - ##### Optional options: object | string | null

    Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. If `encoding` is not supplied, the default of `'utf8'` is used. If `mode` is not supplied, the default of `0o666` is used. If `mode` is a string, it is parsed as an octal integer. If `flag` is not supplied, the default of `'a'` is used.

  #### Returns Promise<void>

### chmod

- chmod(path: PathLike, mode: string | number): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2131

  Asynchronous chmod(2) - Change permissions of a file.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### mode: string | number

    A file mode. If a string is passed, it is parsed as an octal integer.

  #### Returns Promise<void>

### chown

- chown(path: PathLike, uid: number, gid: number): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2156

  Asynchronous chown(2) - Change ownership of a file.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### uid: number

  - ##### gid: number

  #### Returns Promise<void>

### copyFile

- copyFile(src: PathLike, dest: PathLike, flags?: undefined | number): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:1934

  Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it already exists. Node.js makes no guarantees about the atomicity of the copy operation. If an error occurs after the destination file has been opened for writing, Node.js will attempt to remove the destination.

  #### Parameters

  - ##### src: PathLike

    A path to the source file.

  - ##### dest: PathLike

    A path to the destination file.

  - ##### Optional flags: undefined | number

    An optional integer that specifies the behavior of the copy operation. The only supported flag is `fs.constants.COPYFILE_EXCL`, which causes the copy operation to fail if `dest` already exists.

  #### Returns Promise<void>

### fchmod

- fchmod(handle: FileHandle, mode: string | number): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2124

  Asynchronous fchmod(2) - Change permissions of a file.

  #### Parameters

  - ##### handle: FileHandle

    A `FileHandle`.

  - ##### mode: string | number

    A file mode. If a string is passed, it is parsed as an octal integer.

  #### Returns Promise<void>

### fchown

- fchown(handle: FileHandle, uid: number, gid: number): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2150

  Asynchronous fchown(2) - Change ownership of a file.

  #### Parameters

  - ##### handle: FileHandle

    A `FileHandle`.

  - ##### uid: number

  - ##### gid: number

  #### Returns Promise<void>

### fdatasync

- fdatasync(handle: FileHandle): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2021

  Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.

  #### Parameters

  - ##### handle: FileHandle

    A `FileHandle`.

  #### Returns Promise<void>

### fstat

- fstat(handle: FileHandle): Promise<Stats>

- - Defined in node_modules/@types/node/fs.d.ts:2092

  Asynchronous fstat(2) - Get file status.

  #### Parameters

  - ##### handle: FileHandle

    A `FileHandle`.

  #### Returns Promise<Stats>

### fsync

- fsync(handle: FileHandle): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2027

  Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.

  #### Parameters

  - ##### handle: FileHandle

    A `FileHandle`.

  #### Returns Promise<void>

### ftruncate

- ftruncate(handle: FileHandle, len?: undefined | number): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2009

  Asynchronous ftruncate(2) - Truncate a file to a specified length.

  #### Parameters

  - ##### handle: FileHandle

    A `FileHandle`.

  - ##### Optional len: undefined | number

    If not specified, defaults to `0`.

  #### Returns Promise<void>

### futimes

- futimes(handle: FileHandle, atime: string | number | Date, mtime: string | number | Date): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2172

  Asynchronously change file timestamps of the file referenced by the supplied `FileHandle`.

  #### Parameters

  - ##### handle: FileHandle

    A `FileHandle`.

  - ##### atime: string | number | Date

    The last access time. If a string is provided, it will be coerced to number.

  - ##### mtime: string | number | Date

    The last modified time. If a string is provided, it will be coerced to number.

  #### Returns Promise<void>

### lchmod

- lchmod(path: PathLike, mode: string | number): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2138

  Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### mode: string | number

    A file mode. If a string is passed, it is parsed as an octal integer.

  #### Returns Promise<void>

### lchown

- lchown(path: PathLike, uid: number, gid: number): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2144

  Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### uid: number

  - ##### gid: number

  #### Returns Promise<void>

### link

- link(existingPath: PathLike, newPath: PathLike): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2111

  Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file.

  #### Parameters

  - ##### existingPath: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### newPath: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  #### Returns Promise<void>

### lstat

- lstat(path: PathLike): Promise<Stats>

- - Defined in node_modules/@types/node/fs.d.ts:2098

  Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  #### Returns Promise<Stats>

### mkdir

- mkdir(path: PathLike, options?: number | string | MakeDirectoryOptions | null): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2035

  Asynchronous mkdir(2) - create a directory.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### Optional options: number | string | MakeDirectoryOptions | null

    Either the file mode, or an object optionally specifying the file mode and whether parent folders should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.

  #### Returns Promise<void>

### mkdtemp

- mkdtemp(prefix: string, options?: object | BufferEncoding | null): Promise<string>
- mkdtemp(prefix: string, options: object | "buffer"): Promise<Buffer>
- mkdtemp(prefix: string, options?: object | string | null): Promise<string | Buffer>

- - Defined in node_modules/@types/node/fs.d.ts:2200

  Asynchronously creates a unique temporary directory. Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.

  #### Parameters

  - ##### prefix: string

  - ##### Optional options: object | BufferEncoding | null

    The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.

  #### Returns Promise<string>

- - Defined in node_modules/@types/node/fs.d.ts:2207

  Asynchronously creates a unique temporary directory. Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.

  #### Parameters

  - ##### prefix: string

  - ##### options: object | "buffer"

    The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.

  #### Returns Promise<Buffer>

- - Defined in node_modules/@types/node/fs.d.ts:2214

  Asynchronously creates a unique temporary directory. Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.

  #### Parameters

  - ##### prefix: string

  - ##### Optional options: object | string | null

    The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.

  #### Returns Promise<string | Buffer>

### open

- open(path: PathLike, flags: string | number, mode?: string | number): Promise<FileHandle>

- - Defined in node_modules/@types/node/fs.d.ts:1942

  Asynchronous open(2) - open and possibly create a file.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### flags: string | number

  - ##### Optional mode: string | number

    A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`.

  #### Returns Promise<FileHandle>

### read

- read<TBuffer>(handle: FileHandle, buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<object>

- - Defined in node_modules/@types/node/fs.d.ts:1953

  Asynchronously reads data from the file referenced by the supplied `FileHandle`.

  #### Type parameters

  - #### TBuffer: Buffer | Uint8Array

  #### Parameters

  - ##### handle: FileHandle

    A `FileHandle`.

  - ##### buffer: TBuffer

    The buffer that the data will be written to.

  - ##### Optional offset: number | null

    The offset in the buffer at which to start writing.

  - ##### Optional length: number | null

    The number of bytes to read.

  - ##### Optional position: number | null

    The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position.

  #### Returns Promise<object>

### readFile

- readFile(path: PathLike | FileHandle, options?: object | null): Promise<Buffer>
- readFile(path: PathLike | FileHandle, options: object | BufferEncoding): Promise<string>
- readFile(path: PathLike | FileHandle, options?: object | string | null): Promise<string | Buffer>

- - Defined in node_modules/@types/node/fs.d.ts:2252

  Asynchronously reads the entire contents of a file.

  #### Parameters

  - ##### path: PathLike | FileHandle

    A path to a file. If a URL is provided, it must use the `file:` protocol. If a `FileHandle` is provided, the underlying file will not be closed automatically.

  - ##### Optional options: object | null

    An object that may contain an optional flag. If a flag is not provided, it defaults to `'r'`.

  #### Returns Promise<Buffer>

- - Defined in node_modules/@types/node/fs.d.ts:2261

  Asynchronously reads the entire contents of a file.

  #### Parameters

  - ##### path: PathLike | FileHandle

    A path to a file. If a URL is provided, it must use the `file:` protocol. If a `FileHandle` is provided, the underlying file will not be closed automatically.

  - ##### options: object | BufferEncoding

    An object that may contain an optional flag. If a flag is not provided, it defaults to `'r'`.

  #### Returns Promise<string>

- - Defined in node_modules/@types/node/fs.d.ts:2270

  Asynchronously reads the entire contents of a file.

  #### Parameters

  - ##### path: PathLike | FileHandle

    A path to a file. If a URL is provided, it must use the `file:` protocol. If a `FileHandle` is provided, the underlying file will not be closed automatically.

  - ##### Optional options: object | string | null

    An object that may contain an optional flag. If a flag is not provided, it defaults to `'r'`.

  #### Returns Promise<string | Buffer>

### readdir

- readdir(path: PathLike, options?: object | BufferEncoding | null): Promise<string[]>
- readdir(path: PathLike, options: object | "buffer"): Promise<Buffer[]>
- readdir(path: PathLike, options?: object | string | null): Promise<string[] | Buffer[]>

- - Defined in node_modules/@types/node/fs.d.ts:2042

  Asynchronous readdir(3) - read a directory.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### Optional options: object | BufferEncoding | null

    The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.

  #### Returns Promise<string[]>

- - Defined in node_modules/@types/node/fs.d.ts:2049

  Asynchronous readdir(3) - read a directory.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### options: object | "buffer"

    The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.

  #### Returns Promise<Buffer[]>

- - Defined in node_modules/@types/node/fs.d.ts:2056

  Asynchronous readdir(3) - read a directory.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### Optional options: object | string | null

    The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.

  #### Returns Promise<string[] | Buffer[]>

### readlink

- readlink(path: PathLike, options?: object | BufferEncoding | null): Promise<string>
- readlink(path: PathLike, options: object | "buffer"): Promise<Buffer>
- readlink(path: PathLike, options?: object | string | null): Promise<string | Buffer>

- - Defined in node_modules/@types/node/fs.d.ts:2063

  Asynchronous readlink(2) - read value of a symbolic link.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### Optional options: object | BufferEncoding | null

    The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.

  #### Returns Promise<string>

- - Defined in node_modules/@types/node/fs.d.ts:2070

  Asynchronous readlink(2) - read value of a symbolic link.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### options: object | "buffer"

    The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.

  #### Returns Promise<Buffer>

- - Defined in node_modules/@types/node/fs.d.ts:2077

  Asynchronous readlink(2) - read value of a symbolic link.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### Optional options: object | string | null

    The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.

  #### Returns Promise<string | Buffer>

### realpath

- realpath(path: PathLike, options?: object | BufferEncoding | null): Promise<string>
- realpath(path: PathLike, options: object | "buffer"): Promise<Buffer>
- realpath(path: PathLike, options?: object | string | null): Promise<string | Buffer>

- - Defined in node_modules/@types/node/fs.d.ts:2179

  Asynchronous realpath(3) - return the canonicalized absolute pathname.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### Optional options: object | BufferEncoding | null

    The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.

  #### Returns Promise<string>

- - Defined in node_modules/@types/node/fs.d.ts:2186

  Asynchronous realpath(3) - return the canonicalized absolute pathname.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### options: object | "buffer"

    The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.

  #### Returns Promise<Buffer>

- - Defined in node_modules/@types/node/fs.d.ts:2193

  Asynchronous realpath(3) - return the canonicalized absolute pathname.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### Optional options: object | string | null

    The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.

  #### Returns Promise<string | Buffer>

### rename

- rename(oldPath: PathLike, newPath: PathLike): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:1995

  Asynchronous rename(2) - Change the name or location of a file or directory.

  #### Parameters

  - ##### oldPath: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol. URL support is experimental.

  - ##### newPath: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol. URL support is experimental.

  #### Returns Promise<void>

### rmdir

- rmdir(path: PathLike): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2015

  Asynchronous rmdir(2) - delete a directory.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  #### Returns Promise<void>

### stat

- stat(path: PathLike): Promise<Stats>

- - Defined in node_modules/@types/node/fs.d.ts:2104

  Asynchronous stat(2) - Get file status.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  #### Returns Promise<Stats>

### symlink

- symlink(target: PathLike, path: PathLike, type?: string | null): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2086

  Asynchronous symlink(2) - Create a new symbolic link to an existing file.

  #### Parameters

  - ##### target: PathLike

    A path to an existing file. If a URL is provided, it must use the `file:` protocol.

  - ##### path: PathLike

    A path to the new symlink. If a URL is provided, it must use the `file:` protocol.

  - ##### Optional type: string | null

    May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). When using `'junction'`, the `target` argument will automatically be normalized to an absolute path.

  #### Returns Promise<void>

### truncate

- truncate(path: PathLike, len?: undefined | number): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2002

  Asynchronous truncate(2) - Truncate a file to a specified length.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### Optional len: undefined | number

    If not specified, defaults to `0`.

  #### Returns Promise<void>

### unlink

- unlink(path: PathLike): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2117

  Asynchronous unlink(2) - delete a name and possibly the file it refers to.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  #### Returns Promise<void>

### utimes

- utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2164

  Asynchronously change file timestamps of the file referenced by the supplied path.

  #### Parameters

  - ##### path: PathLike

    A path to a file. If a URL is provided, it must use the `file:` protocol.

  - ##### atime: string | number | Date

    The last access time. If a string is provided, it will be coerced to number.

  - ##### mtime: string | number | Date

    The last modified time. If a string is provided, it will be coerced to number.

  #### Returns Promise<void>

### write

- write<TBuffer>(handle: FileHandle, buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<object>
- write(handle: FileHandle, string: any, position?: number | null, encoding?: string | null): Promise<object>

- - Defined in node_modules/@types/node/fs.d.ts:1971

  Asynchronously writes `buffer` to the file referenced by the supplied `FileHandle`. It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended.

  #### Type parameters

  - #### TBuffer: Buffer | Uint8Array

  #### Parameters

  - ##### handle: FileHandle

    A `FileHandle`.

  - ##### buffer: TBuffer

    The buffer that the data will be written to.

  - ##### Optional offset: number | null

    The part of the buffer to be written. If not supplied, defaults to `0`.

  - ##### Optional length: number | null

    The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.

  - ##### Optional position: number | null

    The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.

  #### Returns Promise<object>

- - Defined in node_modules/@types/node/fs.d.ts:1986

  Asynchronously writes `string` to the file referenced by the supplied `FileHandle`. It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended.

  #### Parameters

  - ##### handle: FileHandle

    A `FileHandle`.

  - ##### string: any

    A string to write. If something other than a string is supplied it will be coerced to a string.

  - ##### Optional position: number | null

    The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.

  - ##### Optional encoding: string | null

    The expected string encoding.

  #### Returns Promise<object>

### writeFile

- writeFile(path: PathLike | FileHandle, data: any, options?: object | string | null): Promise<void>

- - Defined in node_modules/@types/node/fs.d.ts:2229

  Asynchronously writes data to a file, replacing the file if it already exists. It is unsafe to call `fsPromises.writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected).

  #### Parameters

  - ##### path: PathLike | FileHandle

    A path to a file. If a URL is provided, it must use the `file:` protocol. URL support is experimental. If a `FileHandle` is provided, the underlying file will not be closed automatically.

  - ##### data: any

    The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string.

  - ##### Optional options: object | string | null

    Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. If `encoding` is not supplied, the default of `'utf8'` is used. If `mode` is not supplied, the default of `0o666` is used. If `mode` is a string, it is parsed as an octal integer. If `flag` is not supplied, the default of `'w'` is used.

  #### Returns Promise<void>

Generated using TypeDoc