Attaches a require hook to persist V8's code cache to disk, significantly speeding up module loading for Node.js applications. Version 2.4.0 is the latest stable release, last updated in October 2021. It works with Node >=5.7.0 (noop on older versions). Key differentiators: zero-config setup (just require it in your entry file), automatic cache invalidation based on V8 version, and notable performance improvements (e.g., 15-50% faster loading for heavy modules like babel-core and yarn). Alternatives like @babel/register or node-persist are more complex or not V8-specific.
npm install v8-compile-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows minimal setup: add v8-compile-cache as the first require to enable cached compilation for all subsequent modules.
Move require('v8-compile-cache') to the very top of your entry file.Periodically delete the cache directory (default: os.tmpdir() + '/v8-compile-cache-<V8_VERSION>') or set V8_COMPILE_CACHE_CACHE_DIR to a managed location.
Consider alternatives like --experimental-vm-modules or native ESM caching. The module is unmaintained for newer Node.js versions.
Look for actively maintained alternatives or use Node's built-in ESM loader hooks.
Clear the cache directory (default in tmp) and restart the application.
Use require('v8-compile-cache') instead of import.Run npm install v8-compile-cache and ensure it is listed in dependencies.
Set DISABLE_V8_COMPILE_CACHE=1 in the same process before any require of v8-compile-cache.
No dependency data recorded yet.