global-cache-dir

JSON →
library 6.0.1 ·javascript
verified Jun 7, 2026

Get the global cache directory (OS-specific) and ensure it exists. Current version 6.0.1, with a stable release cadence via npm. Key differentiators: returns a normalized path using the OS-standard cache location (macOS: ~/Library/Caches, Linux: ~/.cache, Windows: AppData\Local\Cache), auto-creates the directory if missing, and is fully typed with TypeScript definitions. ESM-only, requires Node.js >=18.18.0. Simpler than alternatives like node-cachedir by providing a one-function API with directory creation.