UseResolvePath
katanakit-js / useResolvePath
Function: useResolvePath()
Section titled “Function: useResolvePath()”function useResolvePath(...segments): Promise<string>;Defined in: infrastructure/filesystem/path.service.ts:82
Resolves a sequence of path segments into an absolute path.
Relative segments resolve against process.cwd(); if the first
segment is absolute (like a useGetDirname result), cwd is ignored.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
…segments |
string[] |
Path segments to resolve. |
Returns
Section titled “Returns”Promise<string>
The resolved absolute path.
Example
Section titled “Example”const base = await useGetDirname(import.meta.url);const file = await useResolvePath(base, "../data/books.json");