Skip to content

getCurrentWorkDirectory

Returns the current working directory.

Example

ts
import { 
getCurrentWorkDirectory
} from "@duplojs/server-utils";
import {
E
,
unwrap
} from "@duplojs/utils";
const
result
=
getCurrentWorkDirectory
();
// currentPath: E.Fail | E.Success<string> if (
E
.
isRight
(
result
)) {
const
currentPath
=
unwrap
(
result
);
// currentPath: string }

Syntax

typescript
function getCurrentWorkDirectory(): E.Fail | E.Success<string>

Parameters

This function takes no parameters.

Return value

  • E.Success<string> : the absolute path of the current directory.
  • E.Fail : if reading the current directory fails.

See also

Released under the MIT license.