File: index.js

package info (click to toggle)
node-registry-url 6.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 136 kB
  • sloc: javascript: 100; makefile: 2
file content (7 lines) | stat: -rw-r--r-- 275 bytes parent folder | download
1
2
3
4
5
6
7
import rc from 'rc';

export default function registryUrl(scope) {
	const result = rc('npm', {registry: 'https://registry.npmjs.org/'});
	const url = result[`${scope}:registry`] || result.config_registry || result.registry;
	return url.slice(-1) === '/' ? url : `${url}/`;
}