Skip to content

createTempDir

createTempDir(prefix, parentDirectory?): Promise<string>

Defined in: packages/node/src/fs/create-temp-dir.ts:16

Creates a fresh temporary directory named <prefix>-XXXXXX.

string

The prefix for the temporary directory name.

string

Directory to create it under. Defaults to the OS temporary directory. Pass the eventual destination’s own filesystem when the directory is staging for a rename, which is only atomic within one filesystem.

Promise<string>

A promise that resolves to the path of the newly created temporary directory.