Skip to content

PurePath.asPosix() method

pathlib-ts > PurePath > asPosix

Returns the string representation of the path with forward (/) slashes, regardless of platform.

Signature:

asPosix(): string;

Returns:

string

The path rendered with / separators.

Useful when emitting URLs or interoperating with tooling that expects POSIX separators. On POSIX hosts the string is returned unchanged; on Windows, backslashes are converted.