mirror of
https://github.com/Snigdha-OS/documentation.git
synced 2025-09-07 19:25:13 +02:00
8 lines
333 B
JavaScript
8 lines
333 B
JavaScript
const npmConf = require('@pnpm/npm-conf')
|
|
|
|
module.exports = function getRegistryUrl (scope, npmrc) {
|
|
const rc = npmrc ? { config: { get: (key) => npmrc[key] } } : npmConf()
|
|
const url = rc.config.get(scope + ':registry') || rc.config.get('registry') || npmConf.defaults.registry
|
|
return url.slice(-1) === '/' ? url : url + '/'
|
|
}
|