mkdtemp
mkdtemp(
suffix:string,prefix:string,dir?:string):Promise<string>
Defined in: packages/pythonlib/src/tempfile.node.ts:89
Create a temporary directory and return its path.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
suffix | string | "" | Optional suffix for the directory name |
prefix | string | "tmp" | Optional prefix for the directory name (default: “tmp”) |
dir? | string | undefined | Optional parent directory (default: system temp dir) |
Returns
Promise<string>
Promise of path to the created directory
Example
const dir = await mkdtemp("", "myapp-")// Use directory...await rm(dir, { recursive: true })