Path.readlink() method
pathlib-ts > Path > readlink
Path.readlink() method
Section titled “Path.readlink() method”Return the path to which the symbolic link points.
Signature:
readlink(): Promise<Path>;Returns:
Promise<Path>
Promise resolving to a Path representing the symlink target.
Remarks
Section titled “Remarks”Resolves the link via Node’s fs.readlink and wraps it in a Path instance.
Example
Section titled “Example”Resolving symlinks asynchronously
import { Path } from "pathlib-ts";
const shim = new Path("./node_modules/.bin/esbuild");const target = await shim.readlink();console.log(target.toString());