Skip to content

Paths

In TypeScript, PATHS exposes the packaged resource and view directories. The native SDKs resolve the same bundle locations with resolveBundlePaths and expose the writable per-user directories through their Paths type (the app_info argument comes from resolveAppInfoFromBundle).

import { PATHS } from "electrobun/main";
console.log(PATHS.RESOURCES_FOLDER);
console.log(PATHS.VIEWS_FOLDER);
  • RESOURCES_FOLDER is the app bundle’s Resources directory. The native equivalent is the resources_dir / ResourcesDir field of the bundle paths.
  • VIEWS_FOLDER is Resources/app/views, which backs the views:// protocol.

The native Paths type carries the same fields as Utils.paths in TypeScript: home, appData, config, cache, temp, logs, documents, downloads, desktop, pictures, music, videos, userData, userCache, and userLogs (snake_case in Rust, CamelCase in Go). On every runtime, userData, userCache, and userLogs resolve to <base>/<identifier>/<install-root> using the packaged app identifier and physical install-root name. That root normally matches the packaged release channel. Supported Electrobun v1 updates keep their existing physical root, including stable and older app-name roots, so app data stays in place.

Packaged resources are read-only application content. Modifying a macOS app bundle invalidates its code signature. Use Utils.paths.userData, Utils.paths.userCache, or another writable system directory for mutable data.

For installer builds, Electrobun’s App and Data uninstall action removes the three app-scoped paths (userData, userCache, and userLogs) for only the current identifier and recorded physical install root. See Uninstalling for the exact behavior and platform availability.