Atom

path.name()

Extracts the final normalized component.

Signature

path.name(value[, style])

Parameters

Text path plus optional style.

Returns

String, empty for a root alone.

Behavior

Pure lexical operation.

Errors

Bad path or style.

Example

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