Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/yxz/os/mod.ts>userCacheDir

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

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.