(absolute? platform-path path)
Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
If the given {path} is a zero-length string, false
will be returned.
Parameters:
path
: string
- path to test.Returns: boolean
Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. If the given {path} is a zero-length string, `false` will be returned. **Parameters:** - `path`: `string` - path to test. **Returns:** `boolean`
(basename platform-path path)
(basename platform-path path suffix)
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.
Parameters:
path
: string
- the path to evaluate.suffix
: string | undefined
- optionally, an extension to remove from the result.Returns: 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. **Parameters:** - `path`: `string` - the path to evaluate. - `suffix`: `string | undefined` - optionally, an extension to remove from the result. **Returns:** `string`
(delimiter platform-path)
The platform-specific file delimiter. ';' or ':'.
The platform-specific file delimiter. ';' or ':'.
(dirname platform-path path)
Return the directory name of a path. Similar to the Unix dirname command.
Parameters:
path
: string
- the path to evaluate.Returns: string
Return the directory name of a path. Similar to the Unix dirname command. **Parameters:** - `path`: `string` - the path to evaluate. **Returns:** `string`
(extname platform-path 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.
Parameters:
path
: string
- the path to evaluate.Returns: 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. **Parameters:** - `path`: `string` - the path to evaluate. **Returns:** `string`
(format platform-path path-object)
Returns a path string from an object - the opposite of parse().
Parameters:
path-object
: FormatInputPathObject
- path to evaluate.Returns: string
Returns a path string from an object - the opposite of parse(). **Parameters:** - `path-object`: `FormatInputPathObject` - path to evaluate. **Returns:** `string`
(join platform-path & paths)
Join all arguments together and normalize the resulting path.
Parameters:
paths
: string[]
- paths to join.Returns: string
Join all arguments together and normalize the resulting path. **Parameters:** - `paths`: `string[]` - paths to join. **Returns:** `string`
(normalize platform-path path)
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.
Parameters:
path
: string
- string path to normalize.Returns: 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. **Parameters:** - `path`: `string` - string path to normalize. **Returns:** `string`
(parse platform-path path)
Returns an object from a path string - the opposite of format().
Parameters:
path
: string
- path to evaluate.Returns: ParsedPath
Returns an object from a path string - the opposite of format(). **Parameters:** - `path`: `string` - path to evaluate. **Returns:** `ParsedPath`
(posix platform-path)
Posix specific pathing. Same as parent object on posix.
Posix specific pathing. Same as parent object on posix.
(relative platform-path from to)
Solve the relative path from {from} to {to} based on the current working directory. 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.
Parameters:
from
: string
to
: string
Returns: string
Solve the relative path from {from} to {to} based on the current working directory. 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. **Parameters:** - `from`: `string` - `to`: `string` **Returns:** `string`
(resolve platform-path & paths)
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.
Parameters:
paths
: string[]
- A sequence of paths or path segments.Returns: string
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. **Parameters:** - `paths`: `string[]` - A sequence of paths or path segments. **Returns:** `string`
(sep platform-path)
The platform-specific file separator. '\' or '/'.
The platform-specific file separator. '\\' or '/'.
(to-namespaced-path platform-path path)
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.
Parameters:
path
: string
Returns: 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. **Parameters:** - `path`: `string` **Returns:** `string`
(win-32 platform-path)
Windows specific pathing. Same as parent object on windows
Windows specific pathing. Same as parent object on windows
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close