VDL Plugin SDK

relative

Import from @varavel/vdl-plugin-sdk/utils/paths.

function relative(from, to): string;

Computes the relative path from one location to another.

Parameters

ParameterTypeDescription
fromstringStarting path.
tostringDestination path.

Returns

string

The normalized relative path from from to to.

Example

relative("generated/models", "generated/types/user.ts");
// returns "../types/user.ts"

See

Powered by pathe (MIT License): https://github.com/unjs/pathe