object Path extends Object with Path
Path Singleton
- Annotations
- @native() @JSImport( "path" , JSImport.Namespace )
- Alphabetic
- By Inheritance
- Path
- Path
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
basename(path: String, ext: String = js.native): String
Return the last portion of a path, similar to the Unix basename command.
Return the last portion of a path, similar to the Unix basename command.
- path
must be a string.
- ext
optional, if given, must also be a string.
- returns
the last portion of a path
- Definition Classes
- Path
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
val
delimiter: String
The platform-specific path delimiter, ';' or ':'.
The platform-specific path delimiter, ';' or ':'.
- Definition Classes
- Path
-
def
dirname(path: 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.
- path
must be a string.
- returns
the directory name of a path
- Definition Classes
- Path
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
extname(path: String): String
Return the extension of the path, from the last '.' to end of string in the last portion of the path.
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.
- path
must be a string.
- returns
the extension of the path (e.g. ".jpg")
- Definition Classes
- Path
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
format(pathObject: PathObject): String
Returns a path string from an object.
Returns a path string from an object. This is the opposite of path.parse. If pathObject has dir and base properties, the returned string will be a concatenation of the dir property, the platform-dependent path separator, and the base property. If the dir property is not supplied, the root property will be used as the dir property. However, it will be assumed that the root property already ends with the platform-dependent path separator. In this case, the returned string will be the concatenation of the root property and the base property. If both the dir and the root properties are not supplied, then the returned string will be the contents of the base property. If the base property is not supplied, a concatenation of the name property and the ext property will be used as the base property.
- pathObject
the given path object
- returns
a path string from an object
- Definition Classes
- Path
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
isAbsolute(path: String): Boolean
Determines whether path is an absolute path.
Determines whether path is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
- path
must be a string.
- returns
true, if the path is an absolute path
- Definition Classes
- Path
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
def
join(path1: String, path2: String*): String
Join all arguments together and normalize the resulting path.
Join all arguments together and normalize the resulting path.
- path1
the first portion of the path
- path2
All arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
- returns
a composite path
- Definition Classes
- Path
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
normalize(path: String): String
Normalize a path, taking care of '..' and '.' parts.
Normalize a path, taking care of '..' and '.' parts. path must be a string. 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.
- path
the path to be normalized
- returns
the normalized path
- Definition Classes
- Path
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
parse(path: String): PathObject
Returns an object from a path.
-
val
posix: Path
Provide access to aforementioned path methods but always interact in a posix compatible way.
Provide access to aforementioned path methods but always interact in a posix compatible way.
- Definition Classes
- Path
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
def
relative(from: String, to: String): String
Solve the relative path from from to to.
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, which means we see that:
path.resolve(from, path.relative(from, to)) == path.resolve(to)
- from
must be a string.
- to
must be a string.
- returns
the relative path
- Definition Classes
- Path
-
def
resolve(args: String*): String
Resolves to to an absolute path.
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. Empty string from arguments are ignored.
- args
All arguments must be strings.
- returns
the absolute path
- Definition Classes
- Path
path.resolve([from ...], to)
Example: -
val
sep: String
The platform-specific file separator, '\\' or '/'.
The platform-specific file separator, '\\' or '/'.
- Definition Classes
- Path
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
val
win32: Path
Provide access to aforementioned path methods but always interact in a win32 compatible way.
Provide access to aforementioned path methods but always interact in a win32 compatible way.
- Definition Classes
- Path