Skip to content
0

katanakit-js / useGetCwd

Function: useGetCwd() ​

ts
function useGetCwd(): string | null;

Defined in: src/infrastructure/filesystem/path.service.ts:167

Returns the current working directory of the process (where the command was launched), or null outside a Node-compatible runtime. Use it for project-relative paths; use useGetDirname for file-relative paths.

Returns ​

string | null

The cwd, or null in browsers/edge runtimes.

Example ​

ts
const cwd = useGetCwd(); // "/app" when launched from the project root

Released under the MIT License.