%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/
Upload File :
Create Path :
Current File : //usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/cache-install-dir.js

const crypto = require('crypto')

const { resolve } = require('path')

const cacheInstallDir = ({ npxCache, packages }) => {
  if (!npxCache) {
    throw new Error('Must provide a valid npxCache path')
  }

  // only packages not found in ${prefix}/node_modules
  return resolve(npxCache, getHash(packages))
}

const getHash = (packages) =>
  crypto.createHash('sha512')
    .update(packages.sort((a, b) => a.localeCompare(b, 'en')).join('\n'))
    .digest('hex')
    .slice(0, 16)

module.exports = cacheInstallDir

Zerion Mini Shell 1.0