posix
local posix = require("@std/path/posix")posix.basename
Returns the last component of path, or nil if the path has no components.
(path: Pathlike) -> string?posix.dirname
Returns the directory portion of path as a string (everything except the last component).
(path: Pathlike) -> stringposix.extname
Returns the file extension of path (including the leading dot), or "" if there is none.
(path: Pathlike) -> stringposix.format
Converts path to its POSIX string representation.
(path: Pathlike) -> stringposix.isAbsolute
Returns true if path is absolute (begins with /).
(path: Pathlike) -> booleanposix.join
Joins one or more path segments into a single Path. Each segment after the first must be relative.
(...: Pathlike) -> Pathposix.normalize
Returns a normalized form of path, resolving . and .. components and removing redundant separators.
(path: Pathlike) -> Pathposix.parse
Parses path into a structured Path value.
(path: Pathlike) -> Pathposix.pathmt
pathinterface.PathInterfaceposix.pathmt:__tostring
() -> stringposix.relative
Returns the relative path from from to to. Both paths must be of the same kind (both absolute or both relative).
(from: Pathlike, to: Pathlike) -> Pathposix.resolve
Resolves a sequence of paths into an absolute Path, processing right-to-left and falling back to the current working directory.
(...: Pathlike) -> Path