Skip to content

obsidian-vault-registry

Reads the vaults the desktop Obsidian of this machine knows, from its obsidian.json. A development build uses it to find the vault it deploys into when OBSIDIAN_CONFIG_FOLDER is not set, and to name the candidates when it cannot choose one.

Re-implemented after packages/obsidian-utils/src/vault.ts of obsidian-tools (MIT).

Interface Description
ObsidianVaultRegistryEntry A vault Obsidian knows, as its obsidian.json records it.
ReadObsidianVaultRegistryOptions Options for the functions that read the registry.
Function Description
formatObsidianVaultList Formats a vault list for an error or warning message, one vault per line, the open ones marked.
getObsidianUserDataFolderCandidates Lists the folders the desktop Obsidian may keep its user data, obsidian.json included, in, most likely first: the obsidian folder in %APPDATA% on Windows, ~/Library/Application Support/obsidian on macOS, and on Linux $XDG_CONFIG_HOME/obsidian (or ~/.config/obsidian), then the Flatpak and Snap locations.
readObsidianVaultRegistry Reads the vaults Obsidian knows, most recently opened first.
Variable Description
DEFAULT_OBSIDIAN_VAULT_CONFIG_FOLDER_NAME The folder a vault keeps its Obsidian configuration in, unless the vault changed it.
OBSIDIAN_VAULT_REGISTRY_FILE_NAME The name of the file the desktop Obsidian keeps its vault list in.