F

exists

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

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

Parameters

NameTypeDescription
pathstring

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

inDocuments?boolean

Whether to resolve path relative to documentsPath.

Returns

Promise<boolean>

A promise resolving to whether the file exists.