readSafe
Reads the content of a file safely from the vault.
It covers the case when the file was removed during the reading.
Import:
import { readSafe } from 'obsidian-dev-utils/obsidian/vault';Signature:
function readSafe(app: App, pathOrFile: PathOrFile): Promise<string | null>Parameters:
| Parameter | Type | Description |
|---|---|---|
app | App | The application instance. |
pathOrFile | PathOrFile | The path or file to read. |
Returns: Promise<string | null> — A Promise that resolves to the content of the file or null if the file is missing or deleted.