Skip to main content
Home

@ddd/dir@1.0.3
Built and signed on GitHub Actions

Utilities related to operating system default directory

This package works with DenoIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
94%
Published
6 days ago (1.0.3)
function cacheDir
cacheDir(): string | null

Returns the path to the user's cache directory.

The returned value depends on the operating system and is either a string, containing a value from the following table, or null.

Platform Value Example
Linux $XDG_CACHE_HOME or $HOME/.cache /home/justjavac/.cache
macOS $HOME/Library/Caches /Users/justjavac/Library/Caches
Windows $LOCALAPPDATA C:\Users\justjavac\AppData\Local

Return Type

string | null

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@ddd/dir

Import symbol

import { cacheDir } from "@ddd/dir/cache-dir";
or

Import directly with a jsr specifier

import { cacheDir } from "jsr:@ddd/dir/cache-dir";

Add Package

pnpm i jsr:@ddd/dir
or (using pnpm 10.8 or older)
pnpm dlx jsr add @ddd/dir

Import symbol

import { cacheDir } from "@ddd/dir/cache-dir";

Add Package

yarn add jsr:@ddd/dir
or (using Yarn 4.8 or older)
yarn dlx jsr add @ddd/dir

Import symbol

import { cacheDir } from "@ddd/dir/cache-dir";

Add Package

vlt install jsr:@ddd/dir

Import symbol

import { cacheDir } from "@ddd/dir/cache-dir";

Add Package

npx jsr add @ddd/dir

Import symbol

import { cacheDir } from "@ddd/dir/cache-dir";

Add Package

bunx jsr add @ddd/dir

Import symbol

import { cacheDir } from "@ddd/dir/cache-dir";