Return the last portion of a path. Similar to the Unix basename command. Often used to extract the file name from a fully qualified path.
The path to evaluate.
An extension to remove from the result.
Get the directory name of a path, similar to the Unix dirname command. When an empty path is given, returns the root path.
The file path.
Get the extension of the path.
The file path.
the extension of the file.
The extension is the string from the last occurrence of the .
character to end of string in the last portion of the path, inclusive.
If there is no .
in the last portion of the path, or if the first
character of the basename of path basename is .
, then an
empty string is returned.
Join all arguments together and normalize the resulting path. Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
The string paths to join.
Normalize a string path, reducing '..' and '.' parts. When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. When an empty path is given, returns the root path.
The string path to normalize.
Normalize a file extension to be of the type '.foo'
.
the file extension.
Adds a leading dot if not present and converts to lower case.
Solve the relative path from {from} to {to}.
The source path.
The target path.
If from and to each resolve to the same path (after calling
path.resolve() on each), a zero-length string is returned.
If a zero-length string is passed as from or to, /
will be used instead of the zero-length strings.
Remove the leading slash from a path.
Resolve a sequence of paths or path segments into an absolute path. The root path in the application has no leading slash, so it is removed.
The paths to join.
The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
Starting from leftmost {from} parameter, resolves {to} to an absolute path.
If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory.
Generated using TypeDoc
The namespace for path-related functions.
Note that Jupyter server paths do not start with a leading slash.