N

fs

namespace fs

Functions

F

exists(path: string, inDocuments?: boolean): Promise<boolean>

Checks whether a file exists, resolving relative paths against documentsPath.

Returns

A promise resolving to whether the file exists.

F

readFile(path: string, encoding?: DCDFileManagerEncoding, inDocuments?: boolean): Promise<string>

Reads a file's contents, resolving relative paths against documentsPath.

Returns

A promise resolving to the file's contents.

F

removeFile(path: string): Promise<boolean>

Removes a file or a whole folder within documentsPath.

Returns

A promise resolving to whether anything was removed.

F

writeFile(path: string, content: string, encoding?: DCDFileManagerEncoding): Promise<string>

Writes content to a file within documentsPath.

Returns

A promise resolving once the file is written.

Types

How the native file manager encodes file contents: UTF-8 text or base64 for binary data.

Variables

V

documentsPath: string

Absolute path to the platform's documents directory.