Skip to content

Path.isSymlink() method

pathlib-ts > Path > isSymlink

Resolves to true when the path is a symbolic link.

Signature:

isSymlink(): Promise<boolean>;

Returns:

Promise<boolean>

Promise resolving to true when the entry is a symbolic link.

Promise wrapper around Path.isSymlinkSync().

Checking links while traversing a tree

import { Path } from "pathlib-ts";
const bin = new Path("./node_modules/.bin");
for (const entry of await bin.iterdir()) {
if (await entry.isSymlink()) {
console.log("link:", entry.name);
}
}