registry.7 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. .TH "REGISTRY" "7" "October 2021" "" ""
  2. .SH "NAME"
  3. \fBregistry\fR \- The JavaScript Package Registry
  4. .SS Description
  5. .P
  6. To resolve packages by name and version, npm talks to a registry website
  7. that implements the CommonJS Package Registry specification for reading
  8. package info\.
  9. .P
  10. npm is configured to use the \fBnpm public registry\fR at
  11. https://registry\.npmjs\.org by default\. Use of the npm public registry is
  12. subject to terms of use available at https://docs\.npmjs\.com/policies/terms\|\.
  13. .P
  14. You can configure npm to use any compatible registry you like, and even run
  15. your own registry\. Use of someone else's registry may be governed by their
  16. terms of use\.
  17. .P
  18. npm's package registry implementation supports several
  19. write APIs as well, to allow for publishing packages and managing user
  20. account information\.
  21. .P
  22. The npm public registry is powered by a CouchDB database,
  23. of which there is a public mirror at https://skimdb\.npmjs\.com/registry\|\.
  24. .P
  25. The registry URL used is determined by the scope of the package (see
  26. npm help \fBscope\fP\|\. If no scope is specified, the default registry is used, which is
  27. supplied by the \fBregistry\fP config parameter\. See npm help \fBconfig\fP,
  28. npm help \fBnpmrc\fP, and npm help \fBconfig\fP for more on managing npm's configuration\.
  29. .P
  30. When the default registry is used in a package\-lock or shrinkwrap is has the
  31. special meaning of "the currently configured registry"\. If you create a lock
  32. file while using the default registry you can switch to another registry and
  33. npm will install packages from the new registry, but if you create a lock
  34. file while using a custom registry packages will be installed from that
  35. registry even after you change to another registry\.
  36. .SS Does npm send any information about me back to the registry?
  37. .P
  38. Yes\.
  39. .P
  40. When making requests of the registry npm adds two headers with information
  41. about your environment:
  42. .RS 0
  43. .IP \(bu 2
  44. \fBNpm\-Scope\fP – If your project is scoped, this header will contain its
  45. scope\. In the future npm hopes to build registry features that use this
  46. information to allow you to customize your experience for your
  47. organization\.
  48. .IP \(bu 2
  49. \fBNpm\-In\-CI\fP – Set to "true" if npm believes this install is running in a
  50. continuous integration environment, "false" otherwise\. This is detected by
  51. looking for the following environment variables: \fBCI\fP, \fBTDDIUM\fP,
  52. \fBJENKINS_URL\fP, \fBbamboo\.buildKey\fP\|\. If you'd like to learn more you may find
  53. the original PR \fIhttps://github\.com/npm/npm\-registry\-client/pull/129\fR
  54. interesting\.
  55. This is used to gather better metrics on how npm is used by humans, versus
  56. build farms\.
  57. .RE
  58. .P
  59. The npm registry does not try to correlate the information in these headers
  60. with any authenticated accounts that may be used in the same requests\.
  61. .SS How can I prevent my package from being published in the official registry?
  62. .P
  63. Set \fB"private": true\fP in your \fBpackage\.json\fP to prevent it from being
  64. published at all, or
  65. \fB"publishConfig":{"registry":"http://my\-internal\-registry\.local"}\fP
  66. to force it to be published only to your internal/private registry\.
  67. .P
  68. See npm help \fBpackage\.json\fP for more info on what goes in the package\.json file\.
  69. .SS Where can I find my own, & other's, published packages?
  70. .P
  71. https://www\.npmjs\.com/
  72. .SS See also
  73. .RS 0
  74. .IP \(bu 2
  75. npm help config
  76. .IP \(bu 2
  77. npm help config
  78. .IP \(bu 2
  79. npm help npmrc
  80. .IP \(bu 2
  81. npm help developers
  82. .RE