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

delimiter: String

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

sep: String

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

basename(path: String, ?ext: String): String

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
Name Type Default
path String
ext String (optional)
Returns
String

dirname(path: String): String

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
Name Type
path String
Returns
String

extname(path: String): String

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
Name Type
path String
Returns
String

format(pathObject: PathObject): String

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
Name Type
pathObject PathObject
Returns
String

isAbsolute(path: String): Bool

The path.isAbsolute() method determines if path is an absolute path.

See: https://nodejs.org/api/path.html#path_path_isabsolute_path
Name Type
path String
Returns
Bool

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
Name Type
paths haxe.extern.Rest
Returns
String

normalize(path: String): String

The path.normalize() method normalizes the given path, resolving '..' and '.' segments.

See: https://nodejs.org/api/path.html#path_path_normalize_path
Name Type
path String
Returns
String

parse(path: String): PathObject

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
Name Type
path String
Returns
PathObject

relative(from: String, to: String): String

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
Name Type
from String
to String
Returns
String

resolve(paths: haxe.extern.Rest): String

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
Name Type
paths haxe.extern.Rest
Returns
String

toNamespacedPath(path: String): String

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 Type
path String
Returns
String

Metadata

Name Parameters
:jsRequire "path"