Path.isDirSync() method
pathlib-ts > Path > isDirSync
Path.isDirSync() method
Section titled “Path.isDirSync() method”Tests whether the path is a directory synchronously.
Signature:
isDirSync(options?: { followSymlinks?: boolean; }): boolean;Parameters
Section titled “Parameters”|
Parameter |
Type |
Description |
|---|---|---|
|
options |
{ followSymlinks?: boolean; } |
(Optional) Optional follow-symlink toggle. |
Returns:
boolean
true when the path is a directory.
Remarks
Section titled “Remarks”Returns false for missing paths and surfaces symlink handling via followSymlinks.
Example
Section titled “Example”Distinguishing directories synchronously
import { Path } from "pathlib-ts";
const logs = new Path("./logs");console.log(logs.isDirSync());