Files
pnpm/lib/registry_for.js
2016-01-31 00:34:20 +08:00

14 lines
269 B
JavaScript

var registryUrl = require('registry-url')
/*
* Returns the registry needed for a certain package.
*/
module.exports = function registryFor (pkg) {
if (pkg.substr(0, 1) === '@') {
return registryUrl(pkg.split('/')[0])
} else {
return registryUrl()
}
}