• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2section: using-npm
3title: registry
4description: The JavaScript Package Registry
5---
6
7# registry(7)
8
9##  The JavaScript Package Registry
10
11### Description
12
13To resolve packages by name and version, npm talks to a registry website
14that implements the CommonJS Package Registry specification for reading
15package info.
16
17npm is configured to use npm, Inc.'s public registry at
18<https://registry.npmjs.org> by default. Use of the npm public registry is
19subject to terms of use available at <https://www.npmjs.com/policies/terms>.
20
21You can configure npm to use any compatible registry you like, and even run
22your own registry. Use of someone else's registry may be governed by their
23terms of use.
24
25npm's package registry implementation supports several
26write APIs as well, to allow for publishing packages and managing user
27account information.
28
29The npm public registry is powered by a CouchDB database,
30of which there is a public mirror at
31<https://skimdb.npmjs.com/registry>.  The code for the couchapp is
32available at <https://github.com/npm/npm-registry-couchapp>.
33
34The registry URL used is determined by the scope of the package (see
35[`scope`](/using-npm/scope). If no scope is specified, the default registry is used, which is
36supplied by the `registry` config parameter.  See [`npm config`](/cli-commands/npm-config),
37[`npmrc`](/configuring-npm/npmrc), and [`config`](/using-npm/config) for more on managing npm's configuration.
38
39### Does npm send any information about me back to the registry?
40
41Yes.
42
43When making requests of the registry npm adds two headers with information
44about your environment:
45
46* `Npm-Scope` – If your project is scoped, this header will contain its
47  scope. In the future npm hopes to build registry features that use this
48  information to allow you to customize your experience for your
49  organization.
50* `Npm-In-CI` – Set to "true" if npm believes this install is running in a
51  continuous integration environment, "false" otherwise. This is detected by
52  looking for the following environment variables: `CI`, `TDDIUM`,
53  `JENKINS_URL`, `bamboo.buildKey`. If you'd like to learn more you may find
54  the [original PR](https://github.com/npm/npm-registry-client/pull/129)
55  interesting.
56  This is used to gather better metrics on how npm is used by humans, versus
57  build farms.
58
59The npm registry does not try to correlate the information in these headers
60with any authenticated accounts that may be used in the same requests.
61
62### Can I run my own private registry?
63
64Yes!
65
66The easiest way is to replicate the couch database, and use the same (or
67similar) design doc to implement the APIs.
68
69If you set up continuous replication from the official CouchDB, and then
70set your internal CouchDB as the registry config, then you'll be able
71to read any published packages, in addition to your private ones, and by
72default will only publish internally.
73
74If you then want to publish a package for the whole world to see, you can
75simply override the `--registry` option for that `publish` command.
76
77### I don't want my package published in the official registry. It's private.
78
79Set `"private": true` in your package.json to prevent it from being
80published at all, or
81`"publishConfig":{"registry":"http://my-internal-registry.local"}`
82to force it to be published only to your internal registry.
83
84See [`package.json`](/configuring-npm/package-json) for more info on what goes in the package.json file.
85
86### Will you replicate from my registry into the public one?
87
88No.  If you want things to be public, then publish them into the public
89registry using npm.  What little security there is would be for nought
90otherwise.
91
92### Do I have to use couchdb to build a registry that npm can talk to?
93
94No, but it's way easier.  Basically, yes, you do, or you have to
95effectively implement the entire CouchDB API anyway.
96
97### Is there a website or something to see package docs and such?
98
99Yes, head over to <https://www.npmjs.com/>
100
101### See also
102
103* [npm config](/cli-commands/npm-config)
104* [config](/using-npm/config)
105* [npmrc](/configuring-npm/npmrc)
106* [npm developers](/using-npm/developers)
107* [npm disputes](/using-npm/disputes)
108