Skip to content

Path.absoluteSync() method

pathlib-ts > Path > absoluteSync

Return an absolute path without resolving symlinks, synchronously.

Signature:

absoluteSync(): Path;

Returns:

Path

An absolute Path.

Mirrors Path.absolute() but executes synchronously.

Converting a relative import synchronously

import { Path } from "pathlib-ts";
const relative = new Path("../src/index.ts");
console.log(relative.absoluteSync().toString());