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
Test whether this path is a descendant of the given ancestor path.
An absolute path or string to check against.
Optionalopts: { includeSelf?: boolean }OptionalincludeSelf?: booleanIf true, return true when the paths are identical.
True if this path descends from the ancestor, otherwise false.
Returns true if this filename equals the other filename or filename string
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.
Compute the relative path from the given base path to this path.
The base absolute path.
A relative path that goes from base to this.
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.
Parent directory as string or another path
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.
Resolve additional paths or components against this absolute path.
Similar to join(), except that if any argument is absolute, the current
path is discarded and resolution starts from that argument.
A new instance of this type, representing the resolved path.
Returns the string representation of this path.
Operations available on path-like objects.