PHP 8.2.30
Preview: cache-dir.js Size: 610 B
//opt/alt/alt-nodejs22/root/usr/lib/node_modules/npm/node_modules/pacote/lib/util/cache-dir.js

const { resolve } = require('node:path')
const { tmpdir, homedir } = require('node:os')

module.exports = (fakePlatform = false) => {
  const temp = tmpdir()
  const uidOrPid = process.getuid ? process.getuid() : process.pid
  const home = homedir() || resolve(temp, 'npm-' + uidOrPid)
  const platform = fakePlatform || process.platform
  const cacheExtra = platform === 'win32' ? 'npm-cache' : '.npm'
  const cacheRoot = (platform === 'win32' && process.env.LOCALAPPDATA) || home
  return {
    cacache: resolve(cacheRoot, cacheExtra, '_cacache'),
    tufcache: resolve(cacheRoot, cacheExtra, '_tuf'),
  }
}

Directory Contents

Dirs: 0 × Files: 7

Name Size Perms Modified Actions
427 B lrw-r--r-- 2026-02-23 06:54:00
Edit Download
610 B lrw-r--r-- 2026-02-23 06:54:00
Edit Download
824 B lrw-r--r-- 2026-02-23 06:54:00
Edit Download
567 B lrw-r--r-- 2026-02-23 06:54:00
Edit Download
222 B lrw-r--r-- 2026-02-23 06:54:00
Edit Download
914 B lrw-r--r-- 2026-02-23 06:54:00
Edit Download
238 B lrw-r--r-- 2026-02-23 06:54:00
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).