TemporaryDirectory
Defined in: packages/pythonlib/src/tempfile.node.ts:216
A temporary directory that cleans itself up.
Use the static create() method to instantiate (constructors cannot be async).
Example
const tmp = await TemporaryDirectory.create({ prefix: "myapp-" })// Use tmp.name as directory path...await tmp.cleanup() // Removes directory and contentsProperties
name
readonlyname:string
Defined in: packages/pythonlib/src/tempfile.node.ts:218
The directory path
Methods
cleanup()
cleanup():
Promise<void>
Defined in: packages/pythonlib/src/tempfile.node.ts:241
Remove the temporary directory and its contents.
Returns
Promise<void>
create()
staticcreate(options?:object):Promise<TemporaryDirectory>
Defined in: packages/pythonlib/src/tempfile.node.ts:229
Create a new TemporaryDirectory.
Parameters
| Parameter | Type |
|---|---|
options? | { dir?: string; prefix?: string; suffix?: string; } |
options.dir? | string |
options.prefix? | string |
options.suffix? | string |
Returns
Promise<TemporaryDirectory>