Skip to content
0

katanakit-js / useGetRelativePath

Function: useGetRelativePath() ​

ts
function useGetRelativePath(from, to): Promise<string>;

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

Computes the relative path from from to to.

Parameters ​

ParameterTypeDescription
fromstringOrigin path.
tostringDestination path.

Returns ​

Promise<string>

The relative path between both.

Example ​

ts
await useGetRelativePath("/app/src", "/app/data/books.json"); // "../data/books.json"

Released under the MIT License.