References
#
BaseDirectoryRe-exports: BaseDirectory
#
Variables#
delimiter• Const
delimiter: ";"
| ":"
Provides the platform-specific path segment delimiter:
;
on Windows:
on POSIX
#
Defined in#
sep• Const
sep: "\\"
| "/"
Provides the platform-specific path segment separator:
\
on Windows/
on POSIX
#
Defined in#
Functions#
appDir▸ appDir(): Promise
<string
>
Returns the path to the suggested directory for your app config files.
Resolves to ${configDir}/${bundleIdentifier}
, where bundleIdentifier
is the value configured on tauri.conf.json > tauri > bundle > identifier
.
#
ReturnsPromise
<string
>
#
Defined in#
audioDir▸ audioDir(): Promise
<string
>
Returns the path to the user's audio directory.
#
Platform-specific- Linux: Resolves to
$XDG_MUSIC_DIR
. - macOS: Resolves to
$HOME/Music
. - Windows: Resolves to
{FOLDERID_Music}
.
#
ReturnsPromise
<string
>
#
Defined in#
basename▸ basename(path
, ext?
): Promise
<string
>
Returns the last portion of a path
. Trailing directory separators are ignored.
#
ParametersName | Type | Description |
---|---|---|
path | string | - |
ext? | string | An optional file extension to be removed from the returned path. |
#
ReturnsPromise
<string
>
#
Defined in#
cacheDir▸ cacheDir(): Promise
<string
>
Returns the path to the user's cache directory.
#
Platform-specific- Linux: Resolves to
$XDG_CACHE_HOME
or$HOME/.cache
. - macOS: Resolves to
$HOME/Library/Caches
. - Windows: Resolves to
{FOLDERID_LocalAppData}
.
#
ReturnsPromise
<string
>
#
Defined in#
configDir▸ configDir(): Promise
<string
>
Returns the path to the user's config directory.
#
Platform-specific- Linux: Resolves to
$XDG_CONFIG_HOME
or$HOME/.config
. - macOS: Resolves to
$HOME/Library/Application Support
. - Windows: Resolves to
{FOLDERID_LocalAppData}
.
#
ReturnsPromise
<string
>
#
Defined in#
currentDir▸ currentDir(): Promise
<string
>
Returns the path to the current working directory.
#
ReturnsPromise
<string
>
#
Defined in#
dataDir▸ dataDir(): Promise
<string
>
Returns the path to the user's data directory.
#
Platform-specific- Linux: Resolves to
$XDG_DATA_HOME
or$HOME/.local/share
. - macOS: Resolves to
$HOME/Library/Application Support
. - Windows: Resolves to
{FOLDERID_RoamingAppData}
.
#
ReturnsPromise
<string
>
#
Defined in#
desktopDir▸ desktopDir(): Promise
<string
>
Returns the path to the user's desktop directory.
#
Platform-specific- Linux: Resolves to
$XDG_DESKTOP_DIR
. - macOS: Resolves to
$HOME/Library/Desktop
. - Windows: Resolves to
{FOLDERID_Desktop}
.
#
ReturnsPromise
<string
>
#
Defined in#
dirname▸ dirname(path
): Promise
<string
>
Returns the directory name of a path
. Trailing directory separators are ignored.
#
ParametersName | Type |
---|---|
path | string |
#
ReturnsPromise
<string
>
#
Defined in#
documentDir▸ documentDir(): Promise
<string
>
Returns the path to the user's document directory.
#
Platform-specific- Linux: Resolves to
$XDG_DOCUMENTS_DIR
. - macOS: Resolves to
$HOME/Documents
. - Windows: Resolves to
{FOLDERID_Documents}
.
#
ReturnsPromise
<string
>
#
Defined in#
downloadDir▸ downloadDir(): Promise
<string
>
Returns the path to the user's download directory.
#
Platform-specific- Linux: Resolves to
$XDG_DOWNLOAD_DIR
. - macOS: Resolves to
$HOME/Downloads
. - Windows: Resolves to
{FOLDERID_Downloads}
.
#
ReturnsPromise
<string
>
#
Defined in#
executableDir▸ executableDir(): Promise
<string
>
Returns the path to the user's executable directory.
#
Platform-specific- Linux: Resolves to
$XDG_BIN_HOME/../bin
or$XDG_DATA_HOME/../bin
or$HOME/.local/bin
. - macOS: Not supported.
- Windows: Not supported.
#
ReturnsPromise
<string
>
#
Defined in#
extname▸ extname(path
): Promise
<string
>
Returns the extension of the path
.
#
ParametersName | Type |
---|---|
path | string |
#
ReturnsPromise
<string
>
#
Defined in#
fontDir▸ fontDir(): Promise
<string
>
Returns the path to the user's font directory.
#
Platform-specific- Linux: Resolves to
$XDG_DATA_HOME/fonts
or$HOME/.local/share/fonts
. - macOS: Resolves to
$HOME/Library/Fonts
. - Windows: Not supported.
#
ReturnsPromise
<string
>
#
Defined in#
homeDir▸ homeDir(): Promise
<string
>
Returns the path to the user's home directory.
#
Platform-specific- Linux: Resolves to
$HOME
. - macOS: Resolves to
$HOME
. - Windows: Resolves to
{FOLDERID_Profile}
.
#
ReturnsPromise
<string
>
#
Defined in#
isAbsolute▸ isAbsolute(path
): Promise
<boolean
>
#
ParametersName | Type |
---|---|
path | string |
#
ReturnsPromise
<boolean
>
#
Defined in#
join▸ join(...paths
): Promise
<string
>
Joins all given path
segments together using the platform-specific separator as a delimiter, then normalizes the resulting path.
#
ParametersName | Type | Description |
---|---|---|
...paths | string [] | A sequence of path segments. |
#
ReturnsPromise
<string
>
#
Defined in#
localDataDir▸ localDataDir(): Promise
<string
>
Returns the path to the user's local data directory.
#
Platform-specific- Linux: Resolves to
$XDG_DATA_HOME
or$HOME/.local/share
. - macOS: Resolves to
$HOME/Library/Application Support
. - Windows: Resolves to
{FOLDERID_LocalAppData}
.
#
ReturnsPromise
<string
>
#
Defined in#
normalize▸ normalize(path
): Promise
<string
>
Normalizes the given path
, resolving '..'
and '.'
segments and resolve symolic links.
#
ParametersName | Type |
---|---|
path | string |
#
ReturnsPromise
<string
>
#
Defined in#
pictureDir▸ pictureDir(): Promise
<string
>
Returns the path to the user's picture directory.
#
Platform-specific- Linux: Resolves to
$XDG_PICTURES_DIR
. - macOS: Resolves to
$HOME/Pictures
. - Windows: Resolves to
{FOLDERID_Pictures}
.
#
ReturnsPromise
<string
>
#
Defined in#
publicDir▸ publicDir(): Promise
<string
>
Returns the path to the user's public directory.
#
Platform-specific- Linux: Resolves to
$XDG_PUBLICSHARE_DIR
. - macOS: Resolves to
$HOME/Public
. - Windows: Resolves to
{FOLDERID_Public}
.
#
ReturnsPromise
<string
>
#
Defined in#
resolve▸ resolve(...paths
): Promise
<string
>
Resolves a sequence of paths
or path
segments into an absolute path.
#
ParametersName | Type | Description |
---|---|---|
...paths | string [] | A sequence of paths or path segments. |
#
ReturnsPromise
<string
>
#
Defined in#
resourceDir▸ resourceDir(): Promise
<string
>
Returns the path to the user's resource directory.
#
ReturnsPromise
<string
>
#
Defined in#
runtimeDir▸ runtimeDir(): Promise
<string
>
Returns the path to the user's runtime directory.
#
Platform-specific- Linux: Resolves to
$XDG_RUNTIME_DIR
. - macOS: Not supported.
- Windows: Not supported.
#
ReturnsPromise
<string
>
#
Defined in#
templateDir▸ templateDir(): Promise
<string
>
Returns the path to the user's template directory.
#
Platform-specific- Linux: Resolves to
$XDG_TEMPLATES_DIR
. - macOS: Not supported.
- Windows: Resolves to
{FOLDERID_Templates}
.
#
ReturnsPromise
<string
>
#
Defined in#
videoDir▸ videoDir(): Promise
<string
>
Returns the path to the user's video directory.
#
Platform-specific- Linux: Resolves to
$XDG_VIDEOS_DIR
. - macOS: Resolves to
$HOME/Movies
. - Windows: Resolves to
{FOLDERID_Videos}
.
#
ReturnsPromise
<string
>