Skip to content

createTempFile

Creates a temporary file in the vault with parent folders if needed.

Import:

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

Signature:

function createTempFile(app: App, path: string): Promise<() => Promise<void>>

Parameters:

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

Returns: Promise<() => Promise<void>> — A Promise that resolves to a function that can be called to delete the temporary file and all its created parents.