Returns the extension of the filename including the leading dot, as a string. If the filename has no extension, returns an empty string.
Note that if the filename starts with a dot (e.g. .gitignore),
that dot is considered part of the stem. So .gitignore has
extension '' and .gitignore.bak has extension .bak
The filename component (last path segment) as a Filename.
The parent directory of this path.
The segments of this path as an array of strings.
Returns the stem of the filename, i.e. the part before the extension. If the filename has no extension, returns the entire filename
Note that if the filename starts with a dot (e.g. .gitignore),
that dot is considered part of the stem. So .gitignore and
.gitignore.bak both have stem .gitignore
Join additional path segments to this path.
Accepts relative path objects and Filename segment arguments for type safety, but you can also directly pass strings for convenience. All args are stringified and interpreted as segments to be joined, regardless of whether they start with a path separator.
Any null, undefined, or empty segments are ignored.
A new instance with the segments appended and resulting path normalized.
Replace the filename extension, keeping the stem the same. The passed string can include or omit the leading dot; if omitted, it will be added.
New extension, e.g. json or .json
A new instance with the filename extension replaced.
Replace the filename (last segment).
A new instance with the filename replaced.
Replace the entire directory path through the parent, while keeping the current filename.
A new path rooted at newParent with the same filename.
Replace the filename stem, keeping the extension the same
A new instance with the filename stem replaced.
Returns the string representation of this path.
Operations available on path-like objects.