2011-11-27 01:21:03 +08:00
<!doctype html>
< html >
2013-07-12 23:55:57 +08:00
< title > npm-registry< / title >
2011-11-27 01:21:03 +08:00
< meta http-equiv = "content-type" value = "text/html;utf-8" >
2013-07-12 23:55:57 +08:00
< link rel = "stylesheet" type = "text/css" href = "../../static/style.css" >
2014-04-16 06:31:36 +08:00
< link rel = "canonical" href = "https://www.npmjs.org/doc/misc/npm-registry.html" >
2014-03-20 00:25:40 +08:00
< script async = true src = "../../static/toc.js" > < / script >
2011-11-27 01:21:03 +08:00
< body >
< div id = "wrapper" >
2014-03-20 00:25:40 +08:00
2013-07-12 23:55:57 +08:00
< h1 > < a href = "../misc/npm-registry.html" > npm-registry< / a > < / h1 > < p > The JavaScript Package Registry< / p >
2014-05-06 09:20:40 +08:00
< h2 id = "description" > DESCRIPTION< / h2 >
2011-11-27 01:21:03 +08:00
< p > To resolve packages by name and version, npm talks to a registry website
that implements the CommonJS Package Registry specification for reading
package info.< / p >
2012-08-07 04:07:31 +08:00
< p > Additionally, npm' s package registry implementation supports several
2011-11-27 01:21:03 +08:00
write APIs as well, to allow for publishing packages and managing user
account information.< / p >
< p > The official public npm registry is at < a href = "http://registry.npmjs.org/" > http://registry.npmjs.org/< / a > . It
2014-09-25 05:41:07 +08:00
is powered by a CouchDB database, of which there is a public mirror at
< a href = "http://skimdb.npmjs.com/registry" > http://skimdb.npmjs.com/registry< / a > . The code for the couchapp is
available at < a href = "http://github.com/npm/npm-registry-couchapp" > http://github.com/npm/npm-registry-couchapp< / a > .< / p >
< p > The registry URL used is determined by the scope of the package (see
2014-11-05 07:08:12 +08:00
< code > < a href = "../misc/npm-scope.html" > < a href = "../misc/npm-scope.html" > npm-scope(7)< / a > < / a > < / code > ). If no scope is specified, the default registry is used, which is
supplied by the < code > registry< / code > config parameter. See < code > < a href = "../cli/npm-config.html" > < a href = "../cli/npm-config.html" > npm-config(1)< / a > < / a > < / code > ,
< code > < a href = "../files/npmrc.html" > < a href = "../files/npmrc.html" > npmrc(5)< / a > < / a > < / code > , and < code > < a href = "../misc/npm-config.html" > < a href = "../misc/npm-config.html" > npm-config(7)< / a > < / a > < / code > for more on managing npm' s configuration.< / p >
2014-05-06 09:20:40 +08:00
< h2 id = "can-i-run-my-own-private-registry-" > Can I run my own private registry?< / h2 >
2011-11-27 01:21:03 +08:00
< p > Yes!< / p >
< p > The easiest way is to replicate the couch database, and use the same (or
similar) design doc to implement the APIs.< / p >
< p > If you set up continuous replication from the official CouchDB, and then
2012-08-07 04:07:31 +08:00
set your internal CouchDB as the registry config, then you' ll be able
2011-11-27 01:21:03 +08:00
to read any published packages, in addition to your private ones, and by
default will only publish internally. If you then want to publish a
package for the whole world to see, you can simply override the
< code > --registry< / code > config for that command.< / p >
2014-05-06 09:20:40 +08:00
< h2 id = "i-don-t-want-my-package-published-in-the-official-registry-it-s-private-" > I don' t want my package published in the official registry. It' s private.< / h2 >
2012-08-07 04:07:31 +08:00
< p > Set < code > " private" : true< / code > in your package.json to prevent it from being
2011-11-27 01:21:03 +08:00
published at all, or
2012-08-07 04:07:31 +08:00
< code > " publishConfig" :{" registry" :" http://my-internal-registry.local" }< / code >
2011-11-27 01:21:03 +08:00
to force it to be published only to your internal registry.< / p >
2014-11-05 07:08:12 +08:00
< p > See < code > < a href = "../files/package.json.html" > < a href = "../files/package.json.html" > package.json(5)< / a > < / a > < / code > for more info on what goes in the package.json file.< / p >
2014-05-06 09:20:40 +08:00
< h2 id = "will-you-replicate-from-my-registry-into-the-public-one-" > Will you replicate from my registry into the public one?< / h2 >
2011-11-27 01:21:03 +08:00
< p > No. If you want things to be public, then publish them into the public
registry using npm. What little security there is would be for nought
otherwise.< / p >
2014-05-06 09:20:40 +08:00
< h2 id = "do-i-have-to-use-couchdb-to-build-a-registry-that-npm-can-talk-to-" > Do I have to use couchdb to build a registry that npm can talk to?< / h2 >
2013-08-16 23:19:31 +08:00
< p > No, but it' s way easier. Basically, yes, you do, or you have to
effectively implement the entire CouchDB API anyway.< / p >
2014-05-06 09:20:40 +08:00
< h2 id = "is-there-a-website-or-something-to-see-package-docs-and-such-" > Is there a website or something to see package docs and such?< / h2 >
2015-01-09 06:37:26 +08:00
< p > Yes, head over to < a href = "https://npmjs.com/" > https://npmjs.com/< / a > < / p >
2014-05-06 09:20:40 +08:00
< h2 id = "see-also" > SEE ALSO< / h2 >
< ul >
2014-11-05 07:08:12 +08:00
< li > < a href = "../cli/npm-config.html" > < a href = "../cli/npm-config.html" > npm-config(1)< / a > < / a > < / li >
< li > < a href = "../misc/npm-config.html" > < a href = "../misc/npm-config.html" > npm-config(7)< / a > < / a > < / li >
< li > < a href = "../files/npmrc.html" > < a href = "../files/npmrc.html" > npmrc(5)< / a > < / a > < / li >
< li > < a href = "../misc/npm-developers.html" > < a href = "../misc/npm-developers.html" > npm-developers(7)< / a > < / a > < / li >
< li > < a href = "../misc/npm-disputes.html" > < a href = "../misc/npm-disputes.html" > npm-disputes(7)< / a > < / a > < / li >
2014-05-06 09:20:40 +08:00
< / ul >
2011-11-27 01:21:03 +08:00
< / div >
2014-03-20 00:25:40 +08:00
< table border = 0 cellspacing = 0 cellpadding = 0 id = npmlogo >
< tr > < td style = "width:180px;height:10px;background:rgb(237,127,127)" colspan = 18 > < / td > < / tr >
< tr > < td rowspan = 4 style = "width:10px;height:10px;background:rgb(237,127,127)" > < / td > < td style = "width:40px;height:10px;background:#fff" colspan = 4 > < / td > < td style = "width:10px;height:10px;background:rgb(237,127,127)" rowspan = 4 > < / td > < td style = "width:40px;height:10px;background:#fff" colspan = 4 > < / td > < td rowspan = 4 style = "width:10px;height:10px;background:rgb(237,127,127)" > < / td > < td colspan = 6 style = "width:60px;height:10px;background:#fff" > < / td > < td style = "width:10px;height:10px;background:rgb(237,127,127)" rowspan = 4 > < / td > < / tr >
< tr > < td colspan = 2 style = "width:20px;height:30px;background:#fff" rowspan = 3 > < / td > < td style = "width:10px;height:10px;background:rgb(237,127,127)" rowspan = 3 > < / td > < td style = "width:10px;height:10px;background:#fff" rowspan = 3 > < / td > < td style = "width:20px;height:10px;background:#fff" rowspan = 4 colspan = 2 > < / td > < td style = "width:10px;height:20px;background:rgb(237,127,127)" rowspan = 2 > < / td > < td style = "width:10px;height:10px;background:#fff" rowspan = 3 > < / td > < td style = "width:20px;height:10px;background:#fff" rowspan = 3 colspan = 2 > < / td > < td style = "width:10px;height:10px;background:rgb(237,127,127)" rowspan = 3 > < / td > < td style = "width:10px;height:10px;background:#fff" rowspan = 3 > < / td > < td style = "width:10px;height:10px;background:rgb(237,127,127)" rowspan = 3 > < / td > < / tr >
< tr > < td style = "width:10px;height:10px;background:#fff" rowspan = 2 > < / td > < / tr >
< tr > < td style = "width:10px;height:10px;background:#fff" > < / td > < / tr >
< tr > < td style = "width:60px;height:10px;background:rgb(237,127,127)" colspan = 6 > < / td > < td colspan = 10 style = "width:10px;height:10px;background:rgb(237,127,127)" > < / td > < / tr >
< tr > < td colspan = 5 style = "width:50px;height:10px;background:#fff" > < / td > < td style = "width:40px;height:10px;background:rgb(237,127,127)" colspan = 4 > < / td > < td style = "width:90px;height:10px;background:#fff" colspan = 9 > < / td > < / tr >
< / table >
2015-01-17 16:50:09 +08:00
< p id = "footer" > npm-registry — npm@2.2.0< / p >
2014-03-20 00:25:40 +08:00