1 # registry-url [![Build Status](https://travis-ci.org/sindresorhus/registry-url.svg?branch=master)](https://travis-ci.org/sindresorhus/registry-url)
3 > Get the set npm registry URL
5 It's usually `https://registry.npmjs.org/`, but [configurable](https://www.npmjs.org/doc/misc/npm-config.html#registry).
7 Use this if you do anything with the npm registry as users will expect it to use their configured registry.
13 $ npm install --save registry-url
21 registry = 'https://custom-registry.com/'
25 const registryUrl = require('registry-url');
27 console.log(registryUrl());
28 //=> 'https://custom-registry.com/'
31 It can also retrieve the registry URL associated with an [npm scope](https://docs.npmjs.com/misc/scope).
35 @myco:registry = 'https://custom-registry.com/'
39 const registryUrl = require('registry-url');
41 console.log(registryUrl('@myco'));
42 //=> 'https://custom-registry.com/'
45 If the provided scope is not in the user's `.npmrc` file, then `registry-url` will check for the existence of `registry`, or if that's not set, fallback to the default npm registry.
50 MIT © [Sindre Sorhus](http://sindresorhus.com)