The path module provides path utilities: string operations
(join/resolve/normalize/…), 30+ system and app directory getters,
bundled-resource resolution and the Tauri v2 BaseDirectory name table
— a port of @tauri-apps/api/path and the path plugin.
Key points:
appDataDir / appConfigDir / appCacheDir /
appLocalDataDir / appLogDir getters follow the appId convention
(determined by the plugin's appId constructor option);
localDataDir is the Tauri v2 alias of appLocalDataDir.resolveResource(path) resolves a bundled asset relative path
against the resource directory (absolute paths pass through).sep (POSIX /) and delimiter (POSIX :) are constants.BaseDirectory carries the 23 upstream names (Audio…Template),
usable as options.baseDir for fs/path functions;
resolveBaseDirectory(base) resolves a name to its absolute path.path is a real plugin (pathPlugin({ appId: "com.ztron.hello" }));
its permission strings live in the path: namespace:
| Permission | Grants |
|---|---|
path:default |
all 32 plugin:path|* commands |
path:allow-<hyphenated-cmd> |
a single command (e.g. path:allow-home-dir) |
No scope: path operations never touch the filesystem and pathPlugin
takes no scope option.
Example (adapted from the path sections of
examples/hello/frontend/src/main.ts, UI reporting omitted; the anchor
PATH_APP_DIRS_OK is its real run output):
plugin:path|* totals 32 commands: 7 string operations (join,
resolve, normalize, is_absolute, basename, dirname,
extname), plus sep, home_dir, temp_dir, cwd and 21
system/app directory getters. Full list in the
Commands Reference.
Applicable version: ztron 0.3.1