readLinkSync
import { readLinkSync } from "jsr:@ende/fs/unstable-read-link";function · experimental · requires --allow-read
function readLinkSync(path: string | URL): stringSynchronously returns the path destination of the named symbolic link.
Throws Error if called with a hard link.
Requires allow-read permission.
path: string | URLThe path of the symbolic link.
Returns
The file path pointed by the symbolic link.
Example: Usage
import { readLinkSync } from "@ende/fs/unstable-read-link";
import { symlinkSync } from "@ende/fs/unstable-symlink";
symlinkSync("./test.txt", "./test_link.txt");
const target = readLinkSync("./test_link.txt"); // full path of ./test.txt