Skip to content

UseGetRelativePath

katanakit-js / useGetRelativePath

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

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

Computes the relative path from from to to.

Parameter Type Description
from string Origin path.
to string Destination path.

Promise<string>

The relative path between both.

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