Path.isFileSync() method
pathlib-ts > Path > isFileSync
Path.isFileSync() method
Section titled “Path.isFileSync() method”Tests whether the path is a regular file synchronously.
Signature:
isFileSync(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 points at a file.
Remarks
Section titled “Remarks”Control symlink resolution with followSymlinks, mirroring CPython.
Example
Section titled “Example”Detecting generated bundles synchronously
import { Path } from "pathlib-ts";
const bundle = new Path("./dist/index.html");console.log(bundle.isFileSync());