Path.absolute() method
pathlib-ts > Path > absolute
Path.absolute() method
Section titled “Path.absolute() method”Return an absolute version of this path without resolving symlinks.
Signature:
absolute(): Promise<Path>;Returns:
Promise<Path>
Promise resolving to an absolute Path.
Remarks
Section titled “Remarks”Delegates to Path.resolve() when the path is relative, mirroring CPython’s absolute() behavior.
Example
Section titled “Example”Ensuring an absolute destination asynchronously
import { Path } from "pathlib-ts";
const target = new Path("./dist/output.txt");console.log((await target.absolute()).toString());