Skip to content

Path.isFileSync() method

pathlib-ts > Path > isFileSync

Tests whether the path is a regular file synchronously.

Signature:

isFileSync(options?: {
followSymlinks?: boolean;
}): boolean;

Parameter

Type

Description

options

{ followSymlinks?: boolean; }

(Optional) Optional follow-symlink toggle.

Returns:

boolean

true when the path points at a file.

Control symlink resolution with followSymlinks, mirroring CPython.

Detecting generated bundles synchronously

import { Path } from "pathlib-ts";
const bundle = new Path("./dist/index.html");
console.log(bundle.isFileSync());