Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/yxz/index.ts>os.userCacheDir

Deno Standard Extensions
Go to Latest
function os.userCacheDir
import { os } from "https://deno.land/x/yxz@0.17.0/index.ts";
const { userCacheDir } = os;

Returns the default root directory to use for user-specific cached data. Users should create their own application-specific subdirectory within this one and use that.

On Unix systems, it returns $XDG_CACHE_HOME as specified by https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html if non-empty, else $HOME/.cache. On Darwin, it returns $HOME/Library/Caches. On Windows, it returns %LocalAppData%.

If the location cannot be determined (for example, $HOME is not defined), then it will throw an error.