Skip to main content

Table of contents

Enumerations#

Interfaces#

References#

Dir#

Renames and exports: BaseDirectory

Functions#

copyFile#

copyFile(source: string, destination: string, options?: FsOptions): Promise<void>

Copys a file to a destination.

Parameters:#

NameTypeDefault valueDescription
sourcestring-A path of the file to copy
destinationstring-A path for the destination file
optionsFsOptions{}-

Returns: Promise<void>

Defined in: fs.ts:266


createDir#

createDir(dir: string, options?: FsDirOptions): Promise<void>

Creates a directory. If one of the path's parent components doesn't exist and the recursive option isn't set to true, it will be rejected.

Parameters:#

NameTypeDefault valueDescription
dirstring-Path to the directory to create
optionsFsDirOptions{}-

Returns: Promise<void>

Defined in: fs.ts:222


readBinaryFile#

readBinaryFile(filePath: string, options?: FsOptions): Promise<number[]>

Reads a file as binary.

Parameters:#

NameTypeDefault valueDescription
filePathstring-Path to the file
optionsFsOptions{}-

Returns: Promise<number[]>

A promise resolving to an array of the file bytes.

Defined in: fs.ts:87


readDir#

readDir(dir: string, options?: FsDirOptions): Promise<FileEntry[]>

List directory files.

Parameters:#

NameTypeDefault valueDescription
dirstring-Path to the directory to read
optionsFsDirOptions{}-

Returns: Promise<FileEntry[]>

Defined in: fs.ts:199


readTextFile#

readTextFile(filePath: string, options?: FsOptions): Promise<string>

Reads a file as text.

Parameters:#

NameTypeDefault valueDescription
filePathstring-Path to the file
optionsFsOptions{}-

Returns: Promise<string>

A promise resolving to a string of the file content.

Defined in: fs.ts:66


removeDir#

removeDir(dir: string, options?: FsDirOptions): Promise<void>

Removes a directory. If the directory is not empty and the recursive option isn't set to true, it will be rejected.

Parameters:#

NameTypeDefault valueDescription
dirstring-Path to the directory to remove
optionsFsDirOptions{}-

Returns: Promise<void>

Defined in: fs.ts:244


removeFile#

removeFile(file: string, options?: FsOptions): Promise<void>

Removes a file.

Parameters:#

NameTypeDefault valueDescription
filestring-Path to the file to remove
optionsFsOptions{}-

Returns: Promise<void>

Defined in: fs.ts:289


renameFile#

renameFile(oldPath: string, newPath: string, options?: FsOptions): Promise<void>

Renames a file

Parameters:#

NameTypeDefault valueDescription
oldPathstring-A path of the file to rename
newPathstring-A path of the new file name
optionsFsOptions{}-

Returns: Promise<void>

Defined in: fs.ts:311


writeBinaryFile#

writeBinaryFile(file: FsBinaryFileOption, options?: FsOptions): Promise<void>

Writes a binary file

Parameters:#

NameTypeDefault valueDescription
fileFsBinaryFileOption-File configuration object
optionsFsOptions{}-

Returns: Promise<void>

Defined in: fs.ts:170


writeFile#

writeFile(file: FsTextFileOption, options?: FsOptions): Promise<void>

Writes a text file.

Parameters:#

NameTypeDefault valueDescription
fileFsTextFileOption-File configuration object
optionsFsOptions{}-

Returns: Promise<void>

Defined in: fs.ts:108