11cb0ef41Sopenharmony_ci---
21cb0ef41Sopenharmony_cititle: registry
31cb0ef41Sopenharmony_cisection: 7
41cb0ef41Sopenharmony_cidescription: The JavaScript Package Registry
51cb0ef41Sopenharmony_ci---
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ci### Description
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ciTo resolve packages by name and version, npm talks to a registry website
101cb0ef41Sopenharmony_cithat implements the CommonJS Package Registry specification for reading
111cb0ef41Sopenharmony_cipackage info.
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_cinpm is configured to use the **npm public registry** at
141cb0ef41Sopenharmony_ci<https://registry.npmjs.org> by default. Use of the npm public registry is
151cb0ef41Sopenharmony_cisubject to terms of use available at <https://docs.npmjs.com/policies/terms>.
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_ciYou can configure npm to use any compatible registry you like, and even run
181cb0ef41Sopenharmony_ciyour own registry. Use of someone else's registry may be governed by their
191cb0ef41Sopenharmony_citerms of use.
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_cinpm's package registry implementation supports several
221cb0ef41Sopenharmony_ciwrite APIs as well, to allow for publishing packages and managing user
231cb0ef41Sopenharmony_ciaccount information.
241cb0ef41Sopenharmony_ci
251cb0ef41Sopenharmony_ciThe npm public registry is powered by a CouchDB database,
261cb0ef41Sopenharmony_ciof which there is a public mirror at <https://skimdb.npmjs.com/registry>.
271cb0ef41Sopenharmony_ci
281cb0ef41Sopenharmony_ciThe registry URL used is determined by the scope of the package (see
291cb0ef41Sopenharmony_ci[`scope`](/using-npm/scope). If no scope is specified, the default registry is
301cb0ef41Sopenharmony_ciused, which is supplied by the [`registry` config](/using-npm/config#registry)
311cb0ef41Sopenharmony_ciparameter.  See [`npm config`](/commands/npm-config),
321cb0ef41Sopenharmony_ci[`npmrc`](/configuring-npm/npmrc), and [`config`](/using-npm/config) for more on
331cb0ef41Sopenharmony_cimanaging npm's configuration.
341cb0ef41Sopenharmony_ciAuthentication configuration such as auth tokens and certificates are configured
351cb0ef41Sopenharmony_cispecifically scoped to an individual registry. See
361cb0ef41Sopenharmony_ci[Auth Related Configuration](/configuring-npm/npmrc#auth-related-configuration)
371cb0ef41Sopenharmony_ci
381cb0ef41Sopenharmony_ciWhen the default registry is used in a package-lock or shrinkwrap it has the
391cb0ef41Sopenharmony_cispecial meaning of "the currently configured registry". If you create a lock
401cb0ef41Sopenharmony_cifile while using the default registry you can switch to another registry and
411cb0ef41Sopenharmony_cinpm will install packages from the new registry, but if you create a lock
421cb0ef41Sopenharmony_cifile while using a custom registry packages will be installed from that
431cb0ef41Sopenharmony_ciregistry even after you change to another registry.
441cb0ef41Sopenharmony_ci
451cb0ef41Sopenharmony_ci### Does npm send any information about me back to the registry?
461cb0ef41Sopenharmony_ci
471cb0ef41Sopenharmony_ciYes.
481cb0ef41Sopenharmony_ci
491cb0ef41Sopenharmony_ciWhen making requests of the registry npm adds two headers with information
501cb0ef41Sopenharmony_ciabout your environment:
511cb0ef41Sopenharmony_ci
521cb0ef41Sopenharmony_ci* `Npm-Scope` – If your project is scoped, this header will contain its
531cb0ef41Sopenharmony_ci  scope. In the future npm hopes to build registry features that use this
541cb0ef41Sopenharmony_ci  information to allow you to customize your experience for your
551cb0ef41Sopenharmony_ci  organization.
561cb0ef41Sopenharmony_ci* `Npm-In-CI` – Set to "true" if npm believes this install is running in a
571cb0ef41Sopenharmony_ci  continuous integration environment, "false" otherwise. This is detected by
581cb0ef41Sopenharmony_ci  looking for the following environment variables: `CI`, `TDDIUM`,
591cb0ef41Sopenharmony_ci  `JENKINS_URL`, `bamboo.buildKey`. If you'd like to learn more you may find
601cb0ef41Sopenharmony_ci  the [original PR](https://github.com/npm/npm-registry-client/pull/129)
611cb0ef41Sopenharmony_ci  interesting.
621cb0ef41Sopenharmony_ci  This is used to gather better metrics on how npm is used by humans, versus
631cb0ef41Sopenharmony_ci  build farms.
641cb0ef41Sopenharmony_ci
651cb0ef41Sopenharmony_ciThe npm registry does not try to correlate the information in these headers
661cb0ef41Sopenharmony_ciwith any authenticated accounts that may be used in the same requests.
671cb0ef41Sopenharmony_ci
681cb0ef41Sopenharmony_ci### How can I prevent my package from being published in the official registry?
691cb0ef41Sopenharmony_ci
701cb0ef41Sopenharmony_ciSet `"private": true` in your `package.json` to prevent it from being
711cb0ef41Sopenharmony_cipublished at all, or
721cb0ef41Sopenharmony_ci`"publishConfig":{"registry":"http://my-internal-registry.local"}`
731cb0ef41Sopenharmony_cito force it to be published only to your internal/private registry.
741cb0ef41Sopenharmony_ci
751cb0ef41Sopenharmony_ciSee [`package.json`](/configuring-npm/package-json) for more info on what goes in the package.json file.
761cb0ef41Sopenharmony_ci
771cb0ef41Sopenharmony_ci### Where can I find my (and others') published packages?
781cb0ef41Sopenharmony_ci
791cb0ef41Sopenharmony_ci<https://www.npmjs.com/>
801cb0ef41Sopenharmony_ci
811cb0ef41Sopenharmony_ci### See also
821cb0ef41Sopenharmony_ci
831cb0ef41Sopenharmony_ci* [npm config](/commands/npm-config)
841cb0ef41Sopenharmony_ci* [config](/using-npm/config)
851cb0ef41Sopenharmony_ci* [npmrc](/configuring-npm/npmrc)
861cb0ef41Sopenharmony_ci* [npm developers](/using-npm/developers)
87