Path
js.node.Path (extern class)
The path
module provides utilities for working with file and directory paths.
See: https://nodejs.org/api/path.html#path_path
Static Members
Platform-specific path delimiter:
;
for Windows
:
for POSIX
See: https://nodejs.org/api/path.html#path_path_delimiter
The path.posix
property provides access to POSIX specific implementations of the path
methods.
See: https://nodejs.org/api/path.html#path_path_posix
Provides the platform-specific path segment separator:
\
on Windows
/
on POSIX
See: https://nodejs.org/api/path.html#path_path_sep
The path.win32 property provides access to Windows-specific implementations of the path methods.
See: https://nodejs.org/api/path.html#path_path_win32
The path.basename()
methods returns the last portion of a path
, similar to the Unix basename
command. Trailing directory separators are ignored, see path.sep.
See: https://nodejs.org/api/path.html#path_path_basename_path_ext
The path.dirname()
method returns the directory name of a path
, similar to the Unix dirname
command. Trailing directory separators are ignored, see path.sep.
See: https://nodejs.org/api/path.html#path_path_dirname_path
The path.extname()
method returns the extension of the path
, from the last occurrence of the .
(period) character to end of string in the last portion of the path
.
If there is no .
in the last portion of the path
, or if there are no .
characters other than the first character of the basename of path
(see path.basename()
) ,
an empty string is returned.
See: https://nodejs.org/api/path.html#path_path_extname_path
The path.format() method returns a path string from an object. This is the opposite of path.parse().
See: https://nodejs.org/api/path.html#path_path_format_pathobject
The path.isAbsolute()
method determines if path
is an absolute path.
See: https://nodejs.org/api/path.html#path_path_isabsolute_path
The path.join()
method joins all given path
segments together using the platform-specific separator as a delimiter, then normalizes the resulting path.
See: https://nodejs.org/api/path.html#path_path_join_paths
The path.normalize()
method normalizes the given path
, resolving '..'
and '.'
segments.
See: https://nodejs.org/api/path.html#path_path_normalize_path
The path.parse()
method returns an object whose properties represent significant elements of the path
. Trailing directory separators are ignored, see path.sep.
See: https://nodejs.org/api/path.html#path_path_parse_path
The path.relative()
method returns the relative path from from
to to
based on the current working directory.
If from
and to
each resolve to the same path (after calling path.resolve() on each), a zero-length string is returned.
See: https://nodejs.org/api/path.html#path_path_relative_from_to
The path.resolve()
method resolves a sequence of paths or path segments into an absolute path.
See: https://nodejs.org/api/path.html#path_path_resolve_paths
On Windows systems only, returns an equivalent namespace-prefixed path for the given path
. If path
is not a string, path
will be returned without modifications.
See: https://nodejs.org/api/path.html#path_path_tonamespacedpath_path
Name |
Parameters |
:jsRequire |
"path" |