Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
registry.md62 linesDownload Raw Back to using-npm
1---
2title: Registry
3section: 7
4description: The JavaScript Package Registry
5---
6
7### Description
8
9To resolve packages by name and version, npm talks to a registry website that implements the CommonJS Package Registry specification for reading package info.
10
11npm is configured to use the **npm public registry** at
12<https://registry.npmjs.org> by default.
13Use of the npm public registry is subject to terms of use available at <https://docs.npmjs.com/policies/terms>.
14
15You can configure npm to use any compatible registry you like, and even run your own registry.
16Use of someone else's registry may be governed by their terms of use.
17
18npm's package registry implementation supports several write APIs as well, to allow for publishing packages and managing user account information.
19
20The registry URL used is determined by the scope of the package (see [`scope`](/using-npm/scope).
21If no scope is specified, the default registry is used, which is supplied by the [`registry` config](/using-npm/config#registry) parameter.
22See [`npm config`](/commands/npm-config), [`npmrc`](/configuring-npm/npmrc), and [`config`](/using-npm/config) for more on managing npm's configuration.
23Authentication configuration such as auth tokens and certificates are configured specifically scoped to an individual registry.
24See [Auth Related Configuration](/configuring-npm/npmrc#auth-related-configuration)
25
26When the default registry is used in a package-lock or shrinkwrap it has the special meaning of "the currently configured registry". If you create a lock file while using the default registry you can switch to another registry and npm will install packages from the new registry, but if you create a lock file while using a custom registry packages will be installed from that registry even after you change to another registry.
27
28### Does npm send any information about me back to the registry?
29
30Yes.
31
32When making requests of the registry npm adds two headers with information about your environment:
33
34* `Npm-Scope` – If your project is scoped, this header will contain its scope.
35In the future npm hopes to build registry features that use this information to allow you to customize your experience for your organization.
36* `Npm-In-CI` – Set to "true" if npm believes this install is running in a continuous integration environment, "false" otherwise.
37This is detected by looking for the following environment variables: `CI`, `TDDIUM`,
38  `JENKINS_URL`, `bamboo.buildKey`.
39If you'd like to learn more you may find the [original PR](https://github.com/npm/npm-registry-client/pull/129) interesting.
40  This is used to gather better metrics on how npm is used by humans, versus build farms.
41
42The npm registry does not try to correlate the information in these headers with any authenticated accounts that may be used in the same requests.
43
44### How can I prevent my package from being published in the official registry?
45
46Set `"private": true` in your `package.json` to prevent it from being published at all, or
47`"publishConfig":{"registry":"http://my-internal-registry.local"}`
48to force it to be published only to your internal/private registry.
49
50See [`package.json`](/configuring-npm/package-json) for more info on what goes in the package.json file.
51
52### Where can I find my (and others') published packages?
53
54<https://www.npmjs.com/>
55
56### See also
57
58* [npm config](/commands/npm-config)
59* [config](/using-npm/config)
60* [npmrc](/configuring-npm/npmrc)
61* [npm developers](/using-npm/developers)
62 
codekingpro/portable-devtools · Team Ai