Finds the common standard cache directory (e.g., ./node_modules/.cache) across projects. Version 6.0.0 is the latest stable release, with a yearly release cadence. This package is part of a shared spec adopted by AVA, nyc, and others. Unlike generic cache path utilities (like env-paths), it relies on a package.json discovery algorithm and respects the CACHE_DIR environment variable. Ship TypeScript type definitions and requires Node.js >= 20.
npm install find-cache-directoryNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Finds and optionally creates the cache directory for a project named 'my-app'.
Use import or dynamic import('find-cache-directory').Upgrade Node.js or use v4.x (last CJS version).
Avoid thunk; use `create: true` on options object.
Set CACHE_DIR to an absolute path string to override.
Use `import findCacheDirectory from 'find-cache-directory'` or use dynamic `import('find-cache-directory')`Use `import findCacheDirectory from 'find-cache-directory'` (no curly braces)
Use ESM import syntax
No dependency data recorded yet.