Skip to content

PurePath.parent property

pathlib-ts > PurePath > parent

Returns the lexical (logical) parent of the current path.

Signature:

get parent(): PurePath;

Anchors (e.g. / or drive roots) are idempotent parents of themselves. To walk physical directories, combine this with Path.resolve() to eliminate .. components and symlinks.