Skip to content

cacheDir ​

cacheDir returns the user's platform-standard cache directory (e.g. ~/.cache on Linux).

SignaturecacheDir(): string
tyrus
import { cacheDir } from "tyrus:os";

const cache: string = cacheDir();
print(`cache: ${cache}`);

Never fails the program

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