Path.resolve() method
pathlib-ts > Path > resolve
Path.resolve() method
Section titled “Path.resolve() method”Make the path absolute, resolving symlinks and normalizing segments.
Signature:
resolve(): Promise<Path>;Returns:
Promise<Path>
Promise resolving to a Path pointing to the resolved location.
Remarks
Section titled “Remarks”Uses Node’s resolver to match CPython behavior, including symlink expansion.
Example
Section titled “Example”Resolving user-provided input asynchronously
import { Path } from "pathlib-ts";
async function loadFile(input: string) { const path = await new Path(input).resolve(); return path.readText();}