node/deps/npm/lib/cache/cached-package-root.js

15 lines
387 B
JavaScript
Raw Normal View History

2014-11-05 07:08:12 +08:00
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)
}