
Research
Node.js Fixes AsyncLocalStorage Crash Bug That Could Take Down Production Servers
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.
find-cache-directory
Advanced tools
Finds the common standard cache directory
The nyc and AVA projects decided to standardize on a common directory structure for storing cache information:
# nyc
./node_modules/.cache/nyc
# ava
./node_modules/.cache/ava
# your-module
./node_modules/.cache/your-module
This module makes it easy to correctly locate the cache directory according to this shared spec. If this pattern becomes ubiquitous, clearing the cache for multiple dependencies becomes easy and consistent:
rm -rf ./node_modules/.cache
npm install find-cache-directory
import findCacheDirectory from 'find-cache-directory';
findCacheDirectory({name: 'unicorns'});
//=> '/user/path/node-modules/.cache/unicorns'
Finds the cache directory using the given options.
The algorithm checks for the CACHE_DIR environmental variable and uses it if it is not set to true, false, 1 or 0. If one is not found, it tries to find a package.json file, searching every parent directory of the cwd specified (or implied from other options). It returns a string containing the absolute path to the cache directory, or undefined if package.json was never found or if the node_modules directory is unwritable.
Type: object
Required
Type: string
Should be the same as your project name in package.json.
Type: string[]
An array of files that will be searched for a common parent directory. This common parent directory will be used in lieu of the cwd option below.
Type: string
Default process.cwd()
The directory to start searching for a package.json from.
Type: boolean
Default false
Create the directory synchronously before returning.
CACHE_DIR environment variable to temporarily override the directory that is resolved.cache-manager is a more comprehensive caching solution that provides a consistent API for various storage backends. Unlike find-cache-directory, which only helps in locating a cache directory, cache-manager allows you to manage cache data with features like setting, getting, and deleting cache entries, and supports multiple storage engines.
node-cache is a simple in-memory caching module for Node.js. It provides a straightforward API for storing and retrieving data in memory. While find-cache-directory focuses on finding a directory for cache storage, node-cache is about managing cache data directly in memory, which can be faster but is volatile.
app-root-path is a package that helps in finding the root directory of a Node.js project. While it doesn't specifically deal with cache directories, it can be used in conjunction with find-cache-directory to determine paths relative to the project root, which can be useful for organizing cache directories.
FAQs
Finds the common standard cache directory
We found that find-cache-directory demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.