.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / registry-url / readme.md
1 # registry-url [![Build Status](https://travis-ci.org/sindresorhus/registry-url.svg?branch=master)](https://travis-ci.org/sindresorhus/registry-url)
2
3 > Get the set npm registry URL
4
5 It's usually `https://registry.npmjs.org/`, but [configurable](https://www.npmjs.org/doc/misc/npm-config.html#registry).
6
7 Use this if you do anything with the npm registry as users will expect it to use their configured registry.
8
9
10 ## Install
11
12 ```
13 $ npm install --save registry-url
14 ```
15
16
17 ## Usage
18
19 ```ini
20 # .npmrc
21 registry = 'https://custom-registry.com/'
22 ```
23
24 ```js
25 const registryUrl = require('registry-url');
26
27 console.log(registryUrl());
28 //=> 'https://custom-registry.com/'
29 ```
30
31 It can also retrieve the registry URL associated with an [npm scope](https://docs.npmjs.com/misc/scope).
32
33 ```ini
34 # .npmrc
35 @myco:registry = 'https://custom-registry.com/'
36 ```
37
38 ```js
39 const registryUrl = require('registry-url');
40
41 console.log(registryUrl('@myco'));
42 //=> 'https://custom-registry.com/'
43 ```
44
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.
46
47
48 ## License
49
50 MIT © [Sindre Sorhus](http://sindresorhus.com)