Path.homeSync() method
pathlib-ts > Path > homeSync
Path.homeSync() method
Section titled “Path.homeSync() method”Return the user’s home directory synchronously.
Signature:
static homeSync(): Path;Returns:
A Path instance targeting the user’s home directory.
Exceptions
Section titled “Exceptions”The Error class When the home directory cannot be determined.
Remarks
Section titled “Remarks”Mirrors Path.home() but executes synchronously.
Example
Section titled “Example”Resolving the home directory synchronously
import { Path } from "pathlib-ts";
const home = Path.homeSync();console.log(home.toString());