| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 | .TH "REGISTRY" "7" "August 2021" "" "".SH "NAME"\fBregistry\fR \- The JavaScript Package Registry.SS Description.PTo resolve packages by name and version, npm talks to a registry websitethat implements the CommonJS Package Registry specification for readingpackage info\..Pnpm is configured to use npm, Inc\.'s public registry athttps://registry\.npmjs\.org by default\. Use of the npm public registry issubject to terms of use available at https://www\.npmjs\.com/policies/terms\|\..PYou can configure npm to use any compatible registry you like, and even runyour own registry\. Use of someone else's registry may be governed by theirterms of use\..Pnpm's package registry implementation supports severalwrite APIs as well, to allow for publishing packages and managing useraccount information\..PThe npm public registry is powered by a CouchDB database,of which there is a public mirror athttps://skimdb\.npmjs\.com/registry\|\.  The code for the couchapp isavailable at https://github\.com/npm/npm\-registry\-couchapp\|\..PThe registry URL used is determined by the scope of the package (seenpm help \fBscope\fP\|\. If no scope is specified, the default registry is used, which issupplied by the \fBregistry\fP config parameter\.  See npm help \fBconfig\fP,npm help \fBnpmrc\fP, and npm help \fBconfig\fP for more on managing npm's configuration\..SS Does npm send any information about me back to the registry?.PYes\..PWhen making requests of the registry npm adds two headers with informationabout your environment:.RS 0.IP \(bu 2\fBNpm\-Scope\fP – If your project is scoped, this header will contain itsscope\. In the future npm hopes to build registry features that use thisinformation to allow you to customize your experience for yourorganization\..IP \(bu 2\fBNpm\-In\-CI\fP – Set to "true" if npm believes this install is running in acontinuous integration environment, "false" otherwise\. This is detected bylooking for the following environment variables: \fBCI\fP, \fBTDDIUM\fP,\fBJENKINS_URL\fP, \fBbamboo\.buildKey\fP\|\. If you'd like to learn more you may findthe original PR \fIhttps://github\.com/npm/npm\-registry\-client/pull/129\fRinteresting\.This is used to gather better metrics on how npm is used by humans, versusbuild farms\..RE.PThe npm registry does not try to correlate the information in these headerswith any authenticated accounts that may be used in the same requests\..SS Can I run my own private registry?.PYes!.PThe easiest way is to replicate the couch database, and use the same (orsimilar) design doc to implement the APIs\..PIf you set up continuous replication from the official CouchDB, and thenset your internal CouchDB as the registry config, then you'll be ableto read any published packages, in addition to your private ones, and bydefault will only publish internally\. .PIf you then want to publish a package for the whole world to see, you cansimply override the \fB\-\-registry\fP option for that \fBpublish\fP command\..SS I don't want my package published in the official registry\. It's private\..PSet \fB"private": true\fP in your package\.json to prevent it from beingpublished at all, or\fB"publishConfig":{"registry":"http://my\-internal\-registry\.local"}\fPto force it to be published only to your internal registry\..PSee npm help \fBpackage\.json\fP for more info on what goes in the package\.json file\..SS Will you replicate from my registry into the public one?.PNo\.  If you want things to be public, then publish them into the publicregistry using npm\.  What little security there is would be for noughtotherwise\..SS Do I have to use couchdb to build a registry that npm can talk to?.PNo, but it's way easier\.  Basically, yes, you do, or you have toeffectively implement the entire CouchDB API anyway\..SS Is there a website or something to see package docs and such?.PYes, head over to https://www\.npmjs\.com/.SS See also.RS 0.IP \(bu 2npm help config.IP \(bu 2npm help config.IP \(bu 2npm help npmrc.IP \(bu 2npm help developers.IP \(bu 2npm help disputes.RE
 |