Path.cwdSync() method
pathlib-ts > Path > cwdSync
Path.cwdSync() method
Section titled “Path.cwdSync() method”Create a Path pointing to the current working directory synchronously.
Signature:
static cwdSync(): Path;Returns:
A Path instance targeting the current working directory.
Remarks
Section titled “Remarks”Mirrors Path.cwd() but executes synchronously.
Example
Section titled “Example”Capturing the working directory synchronously
import { Path } from "pathlib-ts";
const cwd = Path.cwdSync();console.log(cwd.toString());