Paths and Resources
Uz.path is a global Uzumaki API for files and platform directories.
const logo = Uz.path.resource('assets/logo.svg');Bundled Resources
Section titled “Bundled Resources”Declare files in uzumaki.config.json:
{ "bundle": { "resources": ["assets/**/*", "data/app.json"] }}Resolve them at runtime:
const logo = Uz.path.resource('assets/logo.svg');const config = Uz.path.resource('data/app.json');
<image src={logo} w={96} h={96} />;resource(rel) returns an absolute path. The same call works in development and packaged builds.
| API | Description |
|---|---|
resource(rel) | Resolve a bundled resource to an absolute path. |
resourceDir | Bundled resource root. |
identifier | App id from config. |
cacheDir() | Platform cache directory, or null. |
dataDir() | Platform data directory, or null. |
configDir() | Platform config directory, or null. |
tempDir() | Writable temp directory. |
exeDir() | Directory of the running executable, or null. |
homeDir() | User home directory, or null. |
Per-App Data Folder
Section titled “Per-App Data Folder”import { join } from 'node:path';
const appData = join( Uz.path.dataDir() ?? Uz.path.tempDir(), Uz.path.identifier,);Use tempDir() as a fallback because some platform directories may be unavailable.
Image Sources
Section titled “Image Sources”<image src> accepts:
- Paths returned by
Uz.path.resource(...) - Absolute file paths
file://URLshttps://URLs
Prefer bundled resources for app-owned assets such as icons, illustrations, and seed data.