deno / 1.23.2 / ~ / deno.realpath.html /

Deno.realPath

Resolves to the absolute normalized path, with symbolic links resolved.

// e.g. given /home/alice/file.txt and current directory /home/alice
await Deno.symlink("file.txt", "symlink_file.txt");
const realPath = await Deno.realPath("./file.txt");
const realSymLinkPath = await Deno.realPath("./symlink_file.txt");
console.log(realPath);  // outputs "/home/alice/file.txt"
console.log(realSymLinkPath);  // outputs "/home/alice/file.txt"

Requires allow-read permission for the target path. Also requires allow-read permission for the CWD if the target path is relative.

function realPath( path: string | URL) : Promise<string>;
realPath( path: string | URL) : Promise<string>

Parameters

path: string | URL

Return Type

Promise<string>

© 2018–2022 the Deno authors
https://doc.deno.land/deno/stable/~/Deno.realPath