How can I change the file name of a note using js?

I’m using a templater .js file, passed on both tp and app arguments.

I’m looking for a functions that is probably somewhere under app.vault…
Perhaps:

app.vault.modify

I’m just uncertain how this works, very bad at reading the api through the console.

Solution:

await tp.file.create_new(file_template, "name", false, "Obsidian Vault/Path/To/Note/Folder/")

or

await tp.file.rename("New Name")

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.