cache-or-tmp-directory

JSON →
library 1.0.0 ·javascript
verified Jun 7, 2026

Returns the system cache directory for a given app name, or falls back to a predictable temporary directory. Version 1.0.0 is stable with no known release cadence. Alternatives like 'cache-directory' require optional dependencies (e.g., osx-tmpdir) and may fail entirely; this package always returns a writable path. It does not create the directory, only provides the path. The temp fallback is non-random, allowing cache sharing across processes. Lightweight, no dependencies, supports Node.js only.