Skip to content

Latest commit

 

History

History
41 lines (33 loc) · 1.37 KB

File metadata and controls

41 lines (33 loc) · 1.37 KB

Paths

app.paths resolves standard OS directories.

Standard directories

app.paths.home();      // user home directory
app.paths.appData();   // OS app data root (e.g. %APPDATA%, ~/Library/Application Support, ~/.local/share)
app.paths.config();    // OS config root
app.paths.cache();     // OS cache root
app.paths.temp();      // OS temp directory
app.paths.logs();      // OS logs root
app.paths.documents();
app.paths.downloads();
app.paths.desktop();
app.paths.pictures();
app.paths.music();
app.paths.videos();

appData(), config(), cache(), and logs() accept an optional name to append a subdirectory: app.paths.appData("MyApp").

Per-app directories

app.paths.userData();  // {appData}/{identifier}/{channel}
app.paths.userCache(); // {cache}/{identifier}/{channel}
app.paths.userLogs();  // {logs}/{identifier}/{channel}
  • identifier comes from "identifier" in buntopconfig.json for compiled builds, falling back to package.json's "name".
  • channel comes from BUNTOP_CHANNEL (embedded as __BUNTOP_CHANNEL__ by the build script), defaulting to "dev" when run via bun run.

These directories are created automatically the first time they're accessed and are the recommended place to store user data, caches, and logs - they're isolated per app and per channel (so dev/beta/release builds of the same app don't collide).