Skip to content

toRelativeFromRoot

Converts an absolute path to a relative path from the root folder of the project.

Import:

import { toRelativeFromRoot } from 'obsidian-dev-utils/script-utils/root';

Signature:

function toRelativeFromRoot(params: ToRelativeFromRootParams): string | null

Parameters:

ParameterTypeDescription
paramsToRelativeFromRootParamsThe parameters for the function.

Returns: string | null — The relative path from the root folder.


Links to this page: