Last change
on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
513 bytes
|
Line | |
---|
1 | const os = require('os')
|
---|
2 | const {resolve} = require('path')
|
---|
3 |
|
---|
4 | module.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.