Path.lstat() method
pathlib-ts > Path > lstat
Path.lstat() method
Section titled “Path.lstat() method”Asynchronously retrieves metadata about a symlink rather than its target. Like Path.stat(), except if the path points to a symlink, the symlink’s status information is returned, rather than its target’s.
Signature:
lstat(): Promise<Stats>;Returns:
Promise<Stats>
A promise resolving to fs.Stats for the link itself.
Remarks
Section titled “Remarks”Mirrors CPython’s Path.lstat() and Node’s fs.lstat behaviour.
Example
Section titled “Example”Checking whether a dependency stub exists
import { Path } from "pathlib-ts";
const link = new Path("./node_modules/.bin/eslint");const stat = await link.lstat();console.log(stat.isSymbolicLink());