Skip to content

createFolderSafe

Creates a folder safely in the specified path.

Import:

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

Signature:

function createFolderSafe(app: App, path: string): Promise<CreateFolderSafeResult>

Parameters:

ParameterTypeDescription
appAppThe application instance.
pathstringThe path of the folder to create.

Returns: Promise<CreateFolderSafeResult> — A Promise that resolves to CreateFolderSafeResult.Created if the folder was created, or CreateFolderSafeResult.NotCreated if it already existed.


Links to this page: