/opt/canhelp/node_modules/next/dist/esm/lib/helpers
NameSizeModeActions
get-cache-directory.js23180644editdlrm
get-cache-directory.js.map34970644editdlrm
get-npx-command.js5390644editdlrm
get-npx-command.js.map9490644editdlrm
get-online.js8620644editdlrm
get-online.js.map15990644editdlrm
get-pkg-manager.js13010644editdlrm
get-pkg-manager.js.map20290644editdlrm
get-registry.js17120644editdlrm
get-registry.js.map26170644editdlrm
get-reserved-port.js19070644editdlrm
get-reserved-port.js.map31580644editdlrm
install.js22600644editdlrm
install.js.map38500644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/esm/lib/helpers/get-cache-directory.js (2318B)
import os from 'os'; import path from 'path'; import fs from 'fs'; // get platform specific cache directory adapted from playwright's handling // https://github.com/microsoft/playwright/blob/7d924470d397975a74a19184c136b3573a974e13/packages/playwright-core/src/utils/registry.ts#L141 export function getCacheDirectory(fileDirectory, envPath) { let result; if (envPath) { result = envPath; } else { let systemCacheDirectory; if (process.platform === 'linux') { systemCacheDirectory = process.env.XDG_CACHE_HOME || path.join(os.homedir(), '.cache'); } else if (process.platform === 'darwin') { systemCacheDirectory = path.join(os.homedir(), 'Library', 'Caches'); } else if (process.platform === 'win32') { systemCacheDirectory = process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local'); } else { /// Attempt to use generic tmp location for un-handled platform if (!systemCacheDirectory) { for (const dir of [ path.join(os.homedir(), '.cache'), path.join(os.tmpdir()) ]){ if (fs.existsSync(dir)) { systemCacheDirectory = dir; break; } } } if (!systemCacheDirectory) { console.error(Object.defineProperty(new Error('Unsupported platform: ' + process.platform), "__NEXT_ERROR_CODE", { value: "E141", enumerable: false, configurable: true })); process.exit(0); } } result = path.join(systemCacheDirectory, fileDirectory); } if (!path.isAbsolute(result)) { // It is important to resolve to the absolute path: // - for unzipping to work correctly; // - so that registry directory matches between installation and execution. // INIT_CWD points to the root of `npm/yarn install` and is probably what // the user meant when typing the relative path. result = path.resolve(process.env['INIT_CWD'] || process.cwd(), result); } return result; } //# sourceMappingURL=get-cache-directory.js.map