Small utility (v2.0.0, 2018) to retrieve the npm cache folder path from environment variables (e.g., npm_config_cache). Case-insensitive lookup of npm config environment variables; returns null if not set. Always resolves relative paths to absolute. No dependencies. Good for tooling that needs to locate npm cache without invoking npm CLI. Last release stable; no recent updates.
npm install npm-cache-envNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Retrieve npm cache directory from environment variables using npm-cache-env.
Use require() or ensure bundler conversion.
Check compatibility, consider using @npmcli/config or reading .npmrc directly.
Handle null explicitly.
Use const npmCacheEnv = require('npm-cache-env'); without destructuring.Run npm install npm-cache-env.
Set the npm_config_cache environment variable or handle null fallback.
No dependency data recorded yet.