MCPcopy Index your code
hub / github.com/nodejs/node / enableCompileCache

Function enableCompileCache

lib/internal/modules/helpers.js:473–497  ·  view source on GitHub ↗

* Enable on-disk compiled cache for all user modules being compiled in the current Node.js instance * after this method is called. * This method accepts either: * - A string: path to the cache directory. * - An options object `{directory?: string, portable?: boolean}`: * - `directory`: A stri

(options)

Source from the content-addressed store, hash-verified

471 * @returns {{status: number, message?: string, directory?: string}}
472 */
473function enableCompileCache(options) {
474 let portable;
475 let directory;
476
477 if (typeof options === 'object' && options !== null) {
478 ({ directory, portable } = options);
479 } else {
480 directory = options;
481 }
482 if (directory === undefined) {
483 directory = process.env.NODE_COMPILE_CACHE || join(lazyTmpdir(), 'node-compile-cache');
484 }
485 if (portable === undefined) {
486 portable = process.env.NODE_COMPILE_CACHE_PORTABLE === '1';
487 }
488 const nativeResult = _enableCompileCache(directory, portable);
489 const result = { status: nativeResult[0] };
490 if (nativeResult[1]) {
491 result.message = nativeResult[1];
492 }
493 if (nativeResult[2]) {
494 result.directory = nativeResult[2];
495 }
496 return result;
497}
498
499const compileCacheStatus = { __proto__: null };
500for (let i = 0; i < _compileCacheStatus.length; ++i) {

Calls 1

joinFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…