Atom

path.extension()

Extracts the last extension.

Signature

path.extension(value[, style])

Parameters

Text path plus optional style.

Returns

String without the dot, or empty.

Behavior

Ignores a leading single dot as an extension separator.

Errors

Bad path or style.

Example

Atom
use path
assert(path.extension('report.tar.gz') == 'gz')