saveNote
Saves the specified note in the Obsidian app.
Calls view.save() on every open markdown view of the note that has unsaved changes. This is a write, and several helpers whose names read as reads call it: readSafe, and getCacheSafe, getFrontmatterSafe and getBacklinksForFileSafe in @mnaoumov/obsidian-lib/metadata-cache.
Import:
import { saveNote } from '@mnaoumov/obsidian-lib/vault';Signature:
function saveNote(app: App, pathOrFile: PathOrFile): Promise<void>Parameters:
| Parameter | Type | Description |
|---|---|---|
app |
App | The Obsidian app instance. |
pathOrFile |
PathOrFile | The note to be saved. |
Returns: Promise<void> — A Promise that resolves when the note is saved.
Links to this page: