Skip to content

makeTemporaryDirectory

Creates a temporary directory.

Example

ts
import { 
SF
} from "@duplojs/server-utils";
import {
E
,
unwrap
} from "@duplojs/utils";
const
result
= await
SF
.
makeTemporaryDirectory
("tmp-");
// result: E.Success<string> | SF.FileSystemLeft if (
E
.
isRight
(
result
)) {
const
tmpDir
=
unwrap
(
result
);
// tmpDir: string }

Syntax

typescript
function makeTemporaryDirectory(
  prefix: string
): Promise<FileSystemLeft | E.Success<string>>

Parameters

  • prefix : prefix for the temporary directory.

Return value

  • E.Success<string> : path of the temporary directory.
  • FileSystemLeft : if creation fails.

See also

Released under the MIT license.