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);import { PATHS } from "electrobun/main";
console.log(PATHS.RESOURCES_FOLDER);console.log(PATHS.VIEWS_FOLDER);// Packaged, read-only bundle locations (backs views://):var bundle_paths = try electrobun.resolveBundlePaths(allocator);defer bundle_paths.deinit(allocator);std.debug.print("{s}\n", .{bundle_paths.resources_dir});
// Writable per-user directories, scoped by app identifier + channel:var paths = try electrobun.Paths.resolve(allocator, app_info);defer paths.deinit(allocator);std.debug.print("{s}\n", .{paths.userData});// Packaged, read-only bundle locations (backs views://):let bundle_paths = electrobun::resolve_bundle_paths()?;println!("{}", bundle_paths.resources_dir.display());
// Writable per-user directories, scoped by app identifier + channel:let paths = Paths::resolve(&app_info)?;println!("{}", paths.user_data);// Packaged, read-only bundle locations (backs views://):bundlePaths, err := electrobun.ResolveBundlePaths()fmt.Println(bundlePaths.ResourcesDir)
// Writable per-user directories, scoped by app identifier + channel:paths, err := electrobun.ResolvePaths(appInfo)fmt.Println(paths.UserData)// Packaged, read-only bundle locations (backs views://):bundle_paths, bundle_err := electrobun.resolveBundlePaths()defer electrobun.deinit(&bundle_paths, context.allocator)fmt.println(bundle_paths.resources_dir)
// Writable per-user directories, scoped by app identifier + channel:paths, paths_err := electrobun.resolvePaths(context.allocator, app_info)defer electrobun.deinit(&paths, context.allocator)fmt.println(paths.userData)RESOURCES_FOLDERis the app bundle’sResourcesdirectory. The native equivalent is theresources_dir/ResourcesDirfield of the bundle paths.VIEWS_FOLDERisResources/app/views, which backs theviews://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.
Webviews can read files beneath userData through the opt-in appdata://
protocol; see Local Webview Assets.
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.