summaryrefslogtreecommitdiff
path: root/deps/npm/lib/cache/cached-package-root.js
blob: 7163314a8ede62aa339ceefdd4fb1ab82aa3973c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var assert = require("assert")
var resolve = require("path").resolve

var npm = require("../npm.js")

module.exports = getCacheRoot

function getCacheRoot (data) {
  assert(data, "must pass package metadata")
  assert(data.name, "package metadata must include name")
  assert(data.version, "package metadata must include version")

  return resolve(npm.cache, data.name, data.version)
}