Skip to content

getCacheSafe

Retrieves the cached metadata for a given file or path.

Import:

import { getCacheSafe } from 'obsidian-dev-utils/obsidian/metadata-cache';

Signature:

function getCacheSafe(app: App, fileOrPath: PathOrFile, options: ParseCacheOptions): Promise<CachedMetadataEx | null>

Parameters:

ParameterTypeDescription
appAppThe Obsidian app instance.
fileOrPathPathOrFileThe file or path to retrieve the metadata for.
optionsParseCacheOptionsThe parse options controlling which additional links to parse.

Returns: Promise<CachedMetadataEx | null> — The cached metadata for the file, or null if it doesn’t exist.


Links to this page: