F

readFile

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

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

Parameters

NameTypeDescription
pathstring

The file path to read, relative to documentsPath unless inDocuments is false.

encoding?DCDFileManagerEncoding

The encoding to read the file with.

inDocuments?boolean

Whether to resolve path relative to documentsPath.

Returns

Promise<string>

A promise resolving to the file's contents.