source: trip-planner-front/node_modules/pacote/lib/util/cache-dir.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 513 bytes
Line 
1const os = require('os')
2const {resolve} = require('path')
3
4module.exports = (fakePlatform = false) => {
5 const temp = os.tmpdir()
6 const uidOrPid = process.getuid ? process.getuid() : process.pid
7 const home = os.homedir() || resolve(temp, 'npm-' + uidOrPid)
8 const platform = fakePlatform || process.platform
9 const cacheExtra = platform === 'win32' ? 'npm-cache' : '.npm'
10 const cacheRoot = (platform === 'win32' && process.env.LOCALAPPDATA) || home
11 return resolve(cacheRoot, cacheExtra, '_cacache')
12}
Note: See TracBrowser for help on using the repository browser.