mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-28 11:01:30 -04:00
14 lines
269 B
JavaScript
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()
|
|
}
|
|
}
|