A drop-in alternative to find-cache-dir that returns a cache directory path in any environment, even outside a module/package folder. Version 4.0.11, maintained in a monorepo with TypeScript types included. Key differentiators: (1) never fails when not inside a module/package, (2) customizable priority order for cache path discovery, (3) async API available. Supports both ESM and CommonJS, with normalized name generation for scoped packages.
npm install cache-pathNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of normalizeName and getCachePath sync/async, including scoped package normalization.
Change import { getCachePath } from 'cache-path' instead of import cachePath from 'cache-path'.Use getCachePathAsync if async I/O acceptable.
Check if the returned path is writable before using.
Run 'npm install cache-path' and ensure import uses named export.
Change to import { getCachePath } from 'cache-path'.Use normalizeName (lowercase n).
No dependency data recorded yet.