fs
namespace fsFunctions
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.
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.
removeFile(path: string): Promise<boolean>
Removes a file or a whole folder within documentsPath.
Returns
A promise resolving to whether anything was removed.
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
documentsPath: string
Absolute path to the platform's documents directory.