Documentation
    Preparing search index...

    Service class for managing metadata in Obsidian files. Encapsulates metadata operations to facilitate testing and decouple from direct API usage.

    Index

    Constructors

    • Creates an instance of MetadataService.

      Parameters

      • metadataCache: MetadataCache

        The Obsidian MetadataCache instance to operate on.

      Returns MetadataService

    Methods

    • Retrieves the YAML frontmatter from a file.

      Parameters

      • file: TFile

        The TFile to retrieve YAML frontmatter from.

      Returns null | CachedMetadata

      The YAML frontmatter as a string, or null if not found.

    • Retrieves the frontmatter metadata from a file.

      Parameters

      • file: TFile

        The TFile to retrieve frontmatter from.

      Returns undefined | Record<string, string | string[]>

      The frontmatter as a record of key-value pairs, or undefined if not found.