Skip to content

dataDir ​

dataDir returns the user's platform-standard data directory (e.g. ~/.local/share on Linux).

SignaturedataDir(): string
tyrus
import { dataDir } from "tyrus:os";

const data: string = dataDir();
print(`data: ${data}`);

Never fails the program

Falls back to an empty string if it cannot be determined, rather than aborting the program.

See also appDataDir for an application-specific subdirectory.