Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno2node/src/deps.deno.ts>Directory#getRelativePathTo

Compile your Deno project to run on Node.js.
Go to Latest
method Directory.prototype.getRelativePathTo
import { Directory } from "https://deno.land/x/deno2node@v1.10.0/src/deps.deno.ts";

Gets the relative path to the specified path.

Parameters

fileOrDirPath: string
  • The file or directory path.

Returns

string

Gets the relative path to another source file.

Parameters

sourceFile: SourceFile
  • Source file.

Returns

string

Gets the relative path to another directory.

Parameters

directory: Directory
  • Directory.

Returns

string