PlatformPath

@native @JSType trait PlatformPath extends StObject
trait StObject
class Object
trait Any
class Object
trait Matchable
class Any

Value members

Concrete methods

def basename(p: String): String

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.

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.

Value Params
ext

optionally, an extension to remove from the result.

p

the path to evaluate.

def basename(p: String, ext: String): String
def dirname(p: String): String

Return the directory name of a path. Similar to the Unix dirname command.

Return the directory name of a path. Similar to the Unix dirname command.

Value Params
p

the path to evaluate.

def extname(p: String): String

Return the extension of the path, from the last '.' to end of string in the last portion of the path. If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string

Return the extension of the path, from the last '.' to end of string in the last portion of the path. If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string

Value Params
p

the path to evaluate.

def format(pP: FormatInputPathObject): String

Returns a path string from an object - the opposite of parse().

Returns a path string from an object - the opposite of parse().

Value Params
pathString

path to evaluate.

def isAbsolute(p: String): Boolean

Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.

Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.

Value Params
path

path to test.

def join(paths: String*): String

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.

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.

Value Params
paths

paths to join.

def normalize(p: String): String

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.

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.

Value Params
p

string path to normalize.

def parse(p: String): ParsedPath

Returns an object from a path string - the opposite of format().

Returns an object from a path string - the opposite of format().

Value Params
pathString

path to evaluate.

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

Solve the relative path from {from} to {to}. At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.

Solve the relative path from {from} to {to}. At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.

def resolve(pathSegments: String*): String

The right-most parameter is considered {to}. Other parameters are considered an array of {from}.

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.

Value Params
pathSegments

string paths to join. Non-string arguments are ignored.

def 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. This method is meaningful only on Windows system. On POSIX systems, the method is non-operational and always returns path without modifications.

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. This method is meaningful only on Windows system. On POSIX systems, the method is non-operational and always returns path without modifications.

Inherited methods

def hasOwnProperty(v: String): Boolean
Inherited from
Object
def isPrototypeOf(v: Object): Boolean
Inherited from
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from
Object
def toLocaleString(): String
Inherited from
Object
def valueOf(): Any
Inherited from
Object

Concrete fields

val delimiter: String

The platform-specific file delimiter. ';' or ':'.

The platform-specific file delimiter. ';' or ':'.

Posix specific pathing. Same as parent object on posix.

Posix specific pathing. Same as parent object on posix.

val sep: String

The platform-specific file separator. '\' or '/'.

The platform-specific file separator. '\' or '/'.

Windows specific pathing. Same as parent object on windows

Windows specific pathing. Same as parent object on windows