Skip to content

Filesystem

Resolve standard OS directories (home, downloads, app data, temp).

Config keyfilesystem
JS namespaceFilesystem
CoreNo
PhasesBindable
Hard deps
PlatformsmacOS · Linux · Windows

JavaScript API

js
import { lune } from "../lunejs/runtime/runtime.js";

const home = await lune.Filesystem.homeDir();
const downloads = await lune.Filesystem.downloadsDir();
const appData = await lune.Filesystem.appDataDir();
const tmp = await lune.Filesystem.tempDir();
MethodReturnsmacOSLinuxWindows
homeDir()Promise<string>~~~
downloadsDir()Promise<string>~/Downloads~/Downloads~/Downloads
appDataDir()Promise<string>~/Library/Application Support$XDG_DATA_HOME or ~/.local/share%APPDATA%
tempDir()Promise<string>/tmp/tmp%TEMP%

Platform notes

  • macOS — Verified.
  • Linux — Untested.
  • Windows — Verified.

Disabling

yaml
plugins:
  disabled:
    - filesystem

Released under the MIT License.