Skip to content

renameSafe

Renames a file safely in the vault. If the new path already exists, the file will be renamed to an available path.

Import:

import { renameSafe } from 'obsidian-dev-utils/obsidian/vault';

Signature:

function renameSafe(params: RenameSafeParams): Promise<string>

Parameters:

ParameterTypeDescription
paramsRenameSafeParamsThe parameters for renaming the file.

Returns: Promise<string> — A Promise that resolves to the new path of the file.


Links to this page: