Get aliases for a given file through api

Hi everyone, I’m new to developing plugins for Obsidian. I’ve been trying to figure out how to get the aliases for a file, but can’t seem to find it through the api or metadata cache. Is there a way to efficiently check if and get an alias for a given file given a path?

Thanks for the help.

1 Like

app.metadataCache.getFileCache(file: TFile).frontmatter

2 Likes

That’s exactly what I needed! Thank you!

Note for any other devs that come across this: you can get access to tags and headings, sections, lists, etc. by using app.metadataCache.getFileCache(file TFile). Very useful