Atom

path.parent()

Drops the final component.

Signature

path.parent(value[, style])

Parameters

Text path plus optional style.

Returns

Normalized parent string.

Behavior

Preserves the root. An empty relative result renders as a dot.

Errors

Bad path or style.

Example

Atom
use path
assert(path.parent('/tmp/data.txt', 'unix') == '/tmp')