UNPKG

1.67 kBMarkdownView Raw
1Registry-specific configuraion
2------------------------------
3
4With `yapm` you can use different npm registries at the same time without changing your config file.
5
6This change still does not allow you to combine packages from different registries.
7
8### config
9
10This is how typical configuration looks like:
11
12```
13[registries."https://registry.npmjs.org/"]
14_auth = (your auth string for public registry)
15email = john-doe@example.org
16ca = null
17
18[registries."http://localhost:4873/"]
19_auth = (your auth string for private registry)
20always-auth = true
21email = john@company.com
22```
23
24It is compatible with npm, and you can override each config option for different registries.
25
26By default yapm saves `_auth` data under its respective registry, so yapm won't expose your passwords to a malicious 3rd party registry by mistake. See [here](multireg-sec.md) for details.
27
28### publishConfig
29
30This feature is long known in npm, but with yapm it's more useful. We recommend to use `publishConfig` to specify registry for each package:
31
32```
33publishConfig: {
34 "registry": "https://registry.npmjs.org/"
35}
36```
37
38If you do that, you can easily publish private and public packages to different places:
39
40```sh
41/tmp$ cd private-pkg
42/tmp/private-pkg$ yapm publish
43 http - PUT http://localhost:4873/private-pkg
44 http - 201 http://localhost:4873/private-pkg
45+ private-pkg@0.1.0
46
47/tmp/private-pkg$ cd ../public
48/tmp/public-pkg$ yapm publish
49 http - PUT https://registry.npmjs.org/public-pkg
50 http - 201 https://registry.npmjs.org/public-pkg
51+ public-pkg@0.1.0
52```
53
54You can have different passwords and auth data for your private and public registry, and you don't have to change configuration.
55