npm: Upgrade to v1.2.11
authorisaacs <i@izs.me>
Fri, 15 Feb 2013 18:49:16 +0000 (10:49 -0800)
committerisaacs <i@izs.me>
Fri, 15 Feb 2013 18:49:30 +0000 (10:49 -0800)
131 files changed:
deps/npm/doc/cli/config.md
deps/npm/doc/cli/faq.md
deps/npm/doc/cli/index.md
deps/npm/doc/cli/stars.md [new file with mode: 0644]
deps/npm/doc/cli/update.md
deps/npm/doc/cli/version.md
deps/npm/html/api/bin.html
deps/npm/html/api/bugs.html
deps/npm/html/api/commands.html
deps/npm/html/api/config.html
deps/npm/html/api/deprecate.html
deps/npm/html/api/docs.html
deps/npm/html/api/edit.html
deps/npm/html/api/explore.html
deps/npm/html/api/help-search.html
deps/npm/html/api/init.html
deps/npm/html/api/install.html
deps/npm/html/api/link.html
deps/npm/html/api/load.html
deps/npm/html/api/ls.html
deps/npm/html/api/npm.html
deps/npm/html/api/outdated.html
deps/npm/html/api/owner.html
deps/npm/html/api/pack.html
deps/npm/html/api/prefix.html
deps/npm/html/api/prune.html
deps/npm/html/api/publish.html
deps/npm/html/api/rebuild.html
deps/npm/html/api/restart.html
deps/npm/html/api/root.html
deps/npm/html/api/run-script.html
deps/npm/html/api/search.html
deps/npm/html/api/shrinkwrap.html
deps/npm/html/api/start.html
deps/npm/html/api/stop.html
deps/npm/html/api/submodule.html
deps/npm/html/api/tag.html
deps/npm/html/api/test.html
deps/npm/html/api/uninstall.html
deps/npm/html/api/unpublish.html
deps/npm/html/api/update.html
deps/npm/html/api/version.html
deps/npm/html/api/view.html
deps/npm/html/api/whoami.html
deps/npm/html/doc/README.html
deps/npm/html/doc/adduser.html
deps/npm/html/doc/bin.html
deps/npm/html/doc/bugs.html
deps/npm/html/doc/build.html
deps/npm/html/doc/bundle.html
deps/npm/html/doc/cache.html
deps/npm/html/doc/changelog.html
deps/npm/html/doc/coding-style.html
deps/npm/html/doc/completion.html
deps/npm/html/doc/config.html
deps/npm/html/doc/dedupe.html
deps/npm/html/doc/deprecate.html
deps/npm/html/doc/developers.html
deps/npm/html/doc/disputes.html
deps/npm/html/doc/docs.html
deps/npm/html/doc/edit.html
deps/npm/html/doc/explore.html
deps/npm/html/doc/faq.html
deps/npm/html/doc/folders.html
deps/npm/html/doc/global.html
deps/npm/html/doc/help-search.html
deps/npm/html/doc/help.html
deps/npm/html/doc/index.html
deps/npm/html/doc/init.html
deps/npm/html/doc/install.html
deps/npm/html/doc/json.html
deps/npm/html/doc/link.html
deps/npm/html/doc/ls.html
deps/npm/html/doc/npm.html
deps/npm/html/doc/outdated.html
deps/npm/html/doc/owner.html
deps/npm/html/doc/pack.html
deps/npm/html/doc/prefix.html
deps/npm/html/doc/prune.html
deps/npm/html/doc/publish.html
deps/npm/html/doc/rebuild.html
deps/npm/html/doc/registry.html
deps/npm/html/doc/removing-npm.html
deps/npm/html/doc/restart.html
deps/npm/html/doc/rm.html
deps/npm/html/doc/root.html
deps/npm/html/doc/run-script.html
deps/npm/html/doc/scripts.html
deps/npm/html/doc/search.html
deps/npm/html/doc/semver.html
deps/npm/html/doc/shrinkwrap.html
deps/npm/html/doc/star.html
deps/npm/html/doc/stars.html [new file with mode: 0644]
deps/npm/html/doc/start.html
deps/npm/html/doc/stop.html
deps/npm/html/doc/submodule.html
deps/npm/html/doc/tag.html
deps/npm/html/doc/test.html
deps/npm/html/doc/uninstall.html
deps/npm/html/doc/unpublish.html
deps/npm/html/doc/update.html
deps/npm/html/doc/version.html
deps/npm/html/doc/view.html
deps/npm/html/doc/whoami.html
deps/npm/lib/cache.js
deps/npm/lib/install.js
deps/npm/lib/npm.js
deps/npm/lib/publish.js
deps/npm/lib/stars.js [new file with mode: 0644]
deps/npm/lib/utils/error-handler.js
deps/npm/lib/utils/sha.js
deps/npm/man/man1/config.1
deps/npm/man/man1/faq.1
deps/npm/man/man1/index.1
deps/npm/man/man1/ls.1
deps/npm/man/man1/npm.1
deps/npm/man/man1/stars.1 [new file with mode: 0644]
deps/npm/man/man1/update.1
deps/npm/man/man1/version.1
deps/npm/man/man3/npm.3
deps/npm/node_modules/glob/glob.js
deps/npm/node_modules/glob/package.json
deps/npm/node_modules/npm-registry-client/README.md
deps/npm/node_modules/npm-registry-client/lib/request.js
deps/npm/node_modules/npm-registry-client/lib/stars.js [new file with mode: 0644]
deps/npm/node_modules/npm-registry-client/node_modules/couch-login/package.json
deps/npm/node_modules/npm-registry-client/package.json
deps/npm/node_modules/read-package-json/package.json
deps/npm/node_modules/read-package-json/read-json.js
deps/npm/package.json
deps/npm/test/packages/npm-test-shrinkwrap/npm-shrinkwrap.json

index 3deafce..e48957b 100644 (file)
@@ -36,11 +36,15 @@ work the same.
 `$HOME/.npmrc` (or the `userconfig` param, if set above)
 
 This file is an ini-file formatted list of `key = value` parameters.
+Environment variables can be replaced using `${VARIABLE_NAME}`. For example:
+
+    prefix = ${HOME}/.npm-packages
 
 ### Global config file
 
 `$PREFIX/etc/npmrc` (or the `globalconfig` param, if set above):
-This file is an ini-file formatted list of `key = value` parameters
+This file is an ini-file formatted list of `key = value` parameters.
+Environment variables can be replaced as above.
 
 ### Built-in config file
 
index 4c83671..d6cc041 100644 (file)
@@ -72,6 +72,52 @@ Write your own package manager, then.  It's not that hard.
 
 npm will not help you do something that is known to be a bad idea.
 
+## `"node_modules"` is the name of my deity's arch-rival, and a Forbidden Word in my religion.  Can I configure npm to use a different folder?
+
+No.  This will never happen.  This question comes up sometimes,
+because it seems silly from the outside that npm couldn't just be
+configured to put stuff somewhere else, and then npm could load them
+from there.  It's an arbitrary spelling choice, right?  What's the bg
+deal?
+
+At the time of this writing, the string `'node_modules'` appears 151
+times in 53 separate files in npm and node core (excluding tests and
+documentation).
+
+Some of these references are in node's built-in module loader.  Since
+npm is not involved **at all** at run-time, node itself would have to
+be configured to know where you've decided to stick stuff.  Complexity
+hurdle #1.  Since the Node module system is locked, this cannot be
+changed, and is enough to kill this request.  But I'll continue, in
+deference to your deity's delicate feelings regarding spelling.
+
+Many of the others are in dependencies that npm uses, which are not
+necessarily tightly coupled to npm (in the sense that they do not read
+npm's configuration files, etc.)  Each of these would have to be
+configured to take the name of the `node_modules` folder as a
+parameter.  Complexity hurdle #2.
+
+Furthermore, npm has the ability to "bundle" dependencies by adding
+the dep names to the `"bundledDependencies"` list in package.json,
+which causes the folder to be included in the package tarball.  What
+if the author of a module bundles its dependencies, and they use a
+different spelling for `node_modules`?  npm would have to rename the
+folder at publish time, and then be smart enough to unpack it using
+your locally configured name.  Complexity hurdle #3.
+
+Furthermore, what happens when you *change* this name?  Fine, it's
+easy enough the first time, just rename the `node_modules` folders to
+`./blergyblerp/` or whatever name you choose.  But what about when you
+change it again?  npm doesn't currently track any state about past
+configuration settings, so this would be rather difficult to do
+properly.  It would have to track every previous value for this
+config, and always accept any of them, or else yesterday's install may
+be broken tomorrow.  Complexity hurdle #5.
+
+Never going to happen.  The folder is named `node_modules`.  It is
+written indelibly in the Node Way, handed down from the ancient times
+of Node 0.3.
+
 ## Should I check my `node_modules` folder into git?
 
 Mikeal Rogers answered this question very well:
index 04852ce..903812d 100644 (file)
@@ -190,6 +190,10 @@ npm-index(1) -- Index of all npm documentation
 
  Mark your favorite packages
 
+## npm-stars(1)
+
+ View packages marked as favorites
+
 ## npm-start(1)
 
  Start a package
diff --git a/deps/npm/doc/cli/stars.md b/deps/npm/doc/cli/stars.md
new file mode 100644 (file)
index 0000000..7c28f5b
--- /dev/null
@@ -0,0 +1,22 @@
+npm-stars(1) -- View packages marked as favorites
+=================================================
+
+## SYNOPSIS
+
+    npm stars
+    npm stars [username]
+
+## DESCRIPTION
+
+If you have starred a lot of neat things and want to find them again
+quickly this command lets you do just that.
+
+You may also want to see your friend's favorite packages, in this case
+you will most certainly enjoy this command.
+
+## SEE ALSO
+
+* npm-star(1)
+* npm-view(1)
+* npm-whoami(1)
+* npm-adduser(1)
index 1de49f2..302e2ef 100644 (file)
@@ -3,7 +3,7 @@ npm-update(1) -- Update a package
 
 ## SYNOPSIS
 
-    npm update [<name> [<name> ...]]
+    npm update [-g] [<name> [<name> ...]]
 
 ## DESCRIPTION
 
@@ -12,6 +12,9 @@ This command will update all the packages listed to the latest version
 
 It will also install missing packages.
 
+If the `-g` flag is specified, this command will update globally installed packages.
+If no package name is specified, all packages in the specified location (global or local) will be updated.
+
 ## SEE ALSO
 
 * npm-install(1)
index ca9b5fb..74d938d 100644 (file)
@@ -27,7 +27,16 @@ resulting version number.  For example:
 
 If the `sign-git-tag` config is set, then the tag will be signed using
 the `-s` flag to git.  Note that you must have a default GPG key set up
-in your git config for this to work properly.
+in your git config for this to work properly.  For example:
+
+    $ npm config set sign-git-tag true
+    $ npm version patch
+
+    You need a passphrase to unlock the secret key for
+    user: "isaacs (http://blog.izs.me/) <i@izs.me>"
+    2048-bit RSA key, ID 6C481CF6, created 2010-08-31
+
+    Enter passphrase:
 
 ## SEE ALSO
 
index 53761a1..762ed89 100644 (file)
@@ -19,7 +19,7 @@
 <p>This function should not be used programmatically.  Instead, just refer
 to the <code>npm.bin</code> member.</p>
 </div>
-<p id="footer">bin &mdash; npm@1.2.10</p>
+<p id="footer">bin &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 7831e95..d7b615f 100644 (file)
@@ -25,7 +25,7 @@ optional version number.</p>
 <p>This command will launch a browser, so this command may not be the most
 friendly for programmatic use.</p>
 </div>
-<p id="footer">bugs &mdash; npm@1.2.10</p>
+<p id="footer">bugs &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 8948891..ee98554 100644 (file)
@@ -28,7 +28,7 @@ usage, or <code>man 3 npm-&lt;command&gt;</code> for programmatic usage.</p>
 
 <ul><li><a href="../doc/index.html">index(1)</a></li></ul>
 </div>
-<p id="footer">commands &mdash; npm@1.2.10</p>
+<p id="footer">commands &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index db52614..facb4ee 100644 (file)
@@ -33,7 +33,7 @@ functions instead.</p>
 
 <ul><li><a href="../api/npm.html">npm(3)</a></li></ul>
 </div>
-<p id="footer">config &mdash; npm@1.2.10</p>
+<p id="footer">config &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index fc46f80..ab671f2 100644 (file)
@@ -32,7 +32,7 @@ install the package.</p></li></ul>
 
 <ul><li><a href="../api/publish.html">publish(3)</a></li><li><a href="../api/unpublish.html">unpublish(3)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
 </div>
-<p id="footer">deprecate &mdash; npm@1.2.10</p>
+<p id="footer">deprecate &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 5cf46ec..1b3d0c8 100644 (file)
@@ -25,7 +25,7 @@ optional version number.</p>
 <p>This command will launch a browser, so this command may not be the most
 friendly for programmatic use.</p>
 </div>
-<p id="footer">docs &mdash; npm@1.2.10</p>
+<p id="footer">docs &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 6d179bd..85acc08 100644 (file)
@@ -30,7 +30,7 @@ to open. The package can optionally have a version number attached.</p>
 <p>Since this command opens an editor in a new process, be careful about where
 and how this is used.</p>
 </div>
-<p id="footer">edit &mdash; npm@1.2.10</p>
+<p id="footer">edit &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 5945efe..ddf38e7 100644 (file)
@@ -24,7 +24,7 @@ sure to use <code>npm rebuild &lt;pkg&gt;</code> if you make any changes.</p>
 
 <p>The first element in the &#39;args&#39; parameter must be a package name.  After that is the optional command, which can be any number of strings. All of the strings will be combined into one, space-delimited command.</p>
 </div>
-<p id="footer">explore &mdash; npm@1.2.10</p>
+<p id="footer">explore &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 79837a8..3615e7e 100644 (file)
@@ -32,7 +32,7 @@ Name of the file that matched</li></ul>
 
 <p>The silent parameter is not neccessary not used, but it may in the future.</p>
 </div>
-<p id="footer">help-search &mdash; npm@1.2.10</p>
+<p id="footer">help-search &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 409018e..a8a62a6 100644 (file)
@@ -35,7 +35,7 @@ then go ahead and use this programmatically.</p>
 
 <p><a href="../doc/json.html">json(1)</a></p>
 </div>
-<p id="footer">init &mdash; npm@1.2.10</p>
+<p id="footer">init &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 2f7d67d..a2a7666 100644 (file)
@@ -25,7 +25,7 @@ the name of a package to be installed.</p>
 <p>Finally, &#39;callback&#39; is a function that will be called when all packages have been
 installed or when an error has been encountered.</p>
 </div>
-<p id="footer">install &mdash; npm@1.2.10</p>
+<p id="footer">install &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 451b0c0..f843262 100644 (file)
@@ -39,7 +39,7 @@ npm.commands.link(&#39;redis&#39;, cb)  # link-install the package</code></pre>
 <p>Now, any changes to the redis package will be reflected in
 the package in the current working directory</p>
 </div>
-<p id="footer">link &mdash; npm@1.2.10</p>
+<p id="footer">link &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 3da18c6..cea0c3f 100644 (file)
@@ -32,7 +32,7 @@ config object.</p>
 
 <p>For a list of all the available command-line configs, see <code>npm help config</code></p>
 </div>
-<p id="footer">load &mdash; npm@1.2.10</p>
+<p id="footer">load &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 3a8753d..5e5671a 100644 (file)
@@ -59,7 +59,7 @@ project.</p>
 This means that if a submodule a same dependency as a parent module, then the
 dependency will only be output once.</p>
 </div>
-<p id="footer">ls &mdash; npm@1.2.10</p>
+<p id="footer">ls &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index c5eb011..26e133c 100644 (file)
@@ -24,7 +24,7 @@ npm.load([configObject,] function (er, npm) {
 
 <h2 id="VERSION">VERSION</h2>
 
-<p>1.2.10</p>
+<p>1.2.11</p>
 
 <h2 id="DESCRIPTION">DESCRIPTION</h2>
 
@@ -92,7 +92,7 @@ method names.  Use the <code>npm.deref</code> method to find the real name.</p>
 
 <pre><code>var cmd = npm.deref(&quot;unp&quot;) // cmd === &quot;unpublish&quot;</code></pre>
 </div>
-<p id="footer">npm &mdash; npm@1.2.10</p>
+<p id="footer">npm &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 3d27712..7a693e0 100644 (file)
@@ -19,7 +19,7 @@ currently outdated.</p>
 
 <p>If the &#39;packages&#39; parameter is left out, npm will check all packages.</p>
 </div>
-<p id="footer">outdated &mdash; npm@1.2.10</p>
+<p id="footer">outdated &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 049f74c..10263d8 100644 (file)
@@ -34,7 +34,7 @@ that is not implemented at this time.</p>
 
 <ul><li><a href="../api/publish.html">publish(3)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
 </div>
-<p id="footer">owner &mdash; npm@1.2.10</p>
+<p id="footer">owner &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 81a6d6e..75bfb97 100644 (file)
@@ -25,7 +25,7 @@ overwritten the second time.</p>
 
 <p>If no arguments are supplied, then npm packs the current package folder.</p>
 </div>
-<p id="footer">pack &mdash; npm@1.2.10</p>
+<p id="footer">pack &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index a1b4e98..14056f2 100644 (file)
@@ -21,7 +21,7 @@
 
 <p>This function is not useful programmatically</p>
 </div>
-<p id="footer">prefix &mdash; npm@1.2.10</p>
+<p id="footer">prefix &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 5268d31..adefa17 100644 (file)
@@ -23,7 +23,7 @@
 <p>Extraneous packages are packages that are not listed on the parent
 package&#39;s dependencies list.</p>
 </div>
-<p id="footer">prune &mdash; npm@1.2.10</p>
+<p id="footer">prune &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index c7602ab..3b50a9e 100644 (file)
@@ -32,7 +32,7 @@ the registry.  Overwrites when the &quot;force&quot; environment variable is set
 
 <ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../api/owner.html">owner(3)</a></li></ul>
 </div>
-<p id="footer">publish &mdash; npm@1.2.10</p>
+<p id="footer">publish &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index d97fdae..c9e805c 100644 (file)
@@ -22,7 +22,7 @@ the new binary. If no &#39;packages&#39; parameter is specify, every package wil
 
 <p>See <code>npm help build</code></p>
 </div>
-<p id="footer">rebuild &mdash; npm@1.2.10</p>
+<p id="footer">rebuild &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 19023e2..0378b94 100644 (file)
@@ -27,7 +27,7 @@ in the <code>packages</code> parameter.</p>
 
 <ul><li><a href="../api/start.html">start(3)</a></li><li><a href="../api/stop.html">stop(3)</a></li></ul>
 </div>
-<p id="footer">restart &mdash; npm@1.2.10</p>
+<p id="footer">restart &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 4191995..d2f6aab 100644 (file)
@@ -21,7 +21,7 @@
 
 <p>This function is not useful programmatically.</p>
 </div>
-<p id="footer">root &mdash; npm@1.2.10</p>
+<p id="footer">root &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index f8dfd4a..5d93e41 100644 (file)
@@ -29,7 +29,7 @@ assumed to be the command to run. All other elements are ignored.</p>
 
 <ul><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../api/test.html">test(3)</a></li><li><a href="../api/start.html">start(3)</a></li><li><a href="../api/restart.html">restart(3)</a></li><li><a href="../api/stop.html">stop(3)</a></li></ul>
 </div>
-<p id="footer">run-script &mdash; npm@1.2.10</p>
+<p id="footer">run-script &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 37bad3f..fefbed5 100644 (file)
@@ -32,7 +32,7 @@ excluded term (the &quot;searchexclude&quot; config). The search is case insensi
 and doesn&#39;t try to read your mind (it doesn&#39;t do any verb tense matching or the
 like).</p>
 </div>
-<p id="footer">search &mdash; npm@1.2.10</p>
+<p id="footer">search &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index d83a8ad..50ca198 100644 (file)
@@ -26,7 +26,7 @@ but the shrinkwrap file will still be written.</p>
 <p>Finally, &#39;callback&#39; is a function that will be called when the shrinkwrap has
 been saved.</p>
 </div>
-<p id="footer">shrinkwrap &mdash; npm@1.2.10</p>
+<p id="footer">shrinkwrap &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 675f3f3..5dbbcb7 100644 (file)
@@ -19,7 +19,7 @@
 <p>npm can run tests on multiple packages. Just specify multiple packages
 in the <code>packages</code> parameter.</p>
 </div>
-<p id="footer">start &mdash; npm@1.2.10</p>
+<p id="footer">start &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 9e36cf9..733a1e2 100644 (file)
@@ -19,7 +19,7 @@
 <p>npm can run stop on multiple packages. Just specify multiple packages
 in the <code>packages</code> parameter.</p>
 </div>
-<p id="footer">stop &mdash; npm@1.2.10</p>
+<p id="footer">stop &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index e156748..b655c41 100644 (file)
@@ -33,7 +33,7 @@ dependencies into the submodule folder.</p>
 
 <ul><li>npm help json</li><li>git help submodule</li></ul>
 </div>
-<p id="footer">submodule &mdash; npm@1.2.10</p>
+<p id="footer">submodule &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 2803372..cee4719 100644 (file)
@@ -29,7 +29,7 @@ parameter is missing or falsey (empty), the default froom the config will be
 used. For more information about how to set this config, check
 <code>man 3 npm-config</code> for programmatic usage or <code>man npm-config</code> for cli usage.</p>
 </div>
-<p id="footer">tag &mdash; npm@1.2.10</p>
+<p id="footer">tag &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 00ba0ea..8086289 100644 (file)
@@ -22,7 +22,7 @@ true.</p>
 <p>npm can run tests on multiple packages. Just specify multiple packages
 in the <code>packages</code> parameter.</p>
 </div>
-<p id="footer">test &mdash; npm@1.2.10</p>
+<p id="footer">test &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 90a6b32..1aac296 100644 (file)
@@ -22,7 +22,7 @@ the name of a package to be uninstalled.</p>
 <p>Finally, &#39;callback&#39; is a function that will be called when all packages have been
 uninstalled or when an error has been encountered.</p>
 </div>
-<p id="footer">uninstall &mdash; npm@1.2.10</p>
+<p id="footer">uninstall &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 349d3dd..43aadee 100644 (file)
@@ -26,7 +26,7 @@ is what is meant.</p>
 <p>If no version is specified, or if all versions are removed then
 the root package entry is removed from the registry entirely.</p>
 </div>
-<p id="footer">unpublish &mdash; npm@1.2.10</p>
+<p id="footer">unpublish &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 740deee..3aa2780 100644 (file)
@@ -18,7 +18,7 @@
 
 <p>The &#39;packages&#39; argument is an array of packages to update. The &#39;callback&#39; parameter will be called when done or when an error occurs.</p>
 </div>
-<p id="footer">update &mdash; npm@1.2.10</p>
+<p id="footer">update &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 3b7b03c..44dc04b 100644 (file)
@@ -24,7 +24,7 @@ fail if the repo is not clean.</p>
 parameter. The difference, however, is this function will fail if it does
 not have exactly one element. The only element should be a version number.</p>
 </div>
-<p id="footer">version &mdash; npm@1.2.10</p>
+<p id="footer">version &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 3617f76..5d3318c 100644 (file)
@@ -99,7 +99,7 @@ the field name.</p>
 
 <p>corresponding to the list of fields selected.</p>
 </div>
-<p id="footer">view &mdash; npm@1.2.10</p>
+<p id="footer">view &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 522b746..8a6bb17 100644 (file)
@@ -21,7 +21,7 @@
 
 <p>This function is not useful programmatically</p>
 </div>
-<p id="footer">whoami &mdash; npm@1.2.10</p>
+<p id="footer">whoami &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index d53f740..6a006e8 100644 (file)
@@ -240,7 +240,7 @@ will no doubt tell you to put the output in a gist or email.</p>
 
 <ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/help.html">help(1)</a></li><li><a href="../doc/index.html">index(1)</a></li></ul>
 </div>
-<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@1.2.10</p>
+<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index f965cde..b0d9e5e 100644 (file)
@@ -39,7 +39,7 @@ authorize on a new machine.</p>
 
 <ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/owner.html">owner(1)</a></li><li><a href="../doc/whoami.html">whoami(1)</a></li></ul>
 </div>
-<p id="footer">adduser &mdash; npm@1.2.10</p>
+<p id="footer">adduser &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index bf863db..45e3004 100644 (file)
@@ -20,7 +20,7 @@
 
 <ul><li><a href="../doc/prefix.html">prefix(1)</a></li><li><a href="../doc/root.html">root(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
 </div>
-<p id="footer">bin &mdash; npm@1.2.10</p>
+<p id="footer">bin &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index c648c5f..dd98bad 100644 (file)
@@ -36,7 +36,7 @@ config param.</p>
 
 <ul><li><a href="../doc/docs.html">docs(1)</a></li><li><a href="../doc/view.html">view(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/json.html">json(1)</a></li></ul>
 </div>
-<p id="footer">bugs &mdash; npm@1.2.10</p>
+<p id="footer">bugs &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 5dbb9e3..05ff474 100644 (file)
@@ -25,7 +25,7 @@ A folder containing a <code>package.json</code> file in its root.</li></ul>
 
 <ul><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/link.html">link(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/json.html">json(1)</a></li></ul>
 </div>
-<p id="footer">build &mdash; npm@1.2.10</p>
+<p id="footer">build &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index c1425bb..bdb98c2 100644 (file)
@@ -20,7 +20,7 @@ install packages into the local space.</p>
 
 <ul><li><a href="../doc/install.html">install(1)</a></li></ul>
 </div>
-<p id="footer">bundle &mdash; npm@1.2.10</p>
+<p id="footer">bundle &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index efa25c5..da99303 100644 (file)
@@ -66,7 +66,7 @@ they do not make an HTTP request to the registry.</p>
 
 <ul><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/pack.html">pack(1)</a></li></ul>
 </div>
-<p id="footer">cache &mdash; npm@1.2.10</p>
+<p id="footer">cache &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 06e6b71..cae5b2b 100644 (file)
@@ -65,7 +65,7 @@
 
 <ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li></ul>
 </div>
-<p id="footer">changelog &mdash; npm@1.2.10</p>
+<p id="footer">changelog &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 120c2e0..a595d40 100644 (file)
@@ -182,7 +182,7 @@ set to anything.&quot;</p>
 
 <ul><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li></ul>
 </div>
-<p id="footer">coding-style &mdash; npm@1.2.10</p>
+<p id="footer">coding-style &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index cc0128b..cb8f57e 100644 (file)
@@ -33,7 +33,7 @@ completions based on the arguments.</p>
 
 <ul><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li></ul>
 </div>
-<p id="footer">completion &mdash; npm@1.2.10</p>
+<p id="footer">completion &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index fbab250..7a15988 100644 (file)
@@ -42,12 +42,16 @@ work the same.</p>
 
 <p><code>$HOME/.npmrc</code> (or the <code>userconfig</code> param, if set above)</p>
 
-<p>This file is an ini-file formatted list of <code>key = value</code> parameters.</p>
+<p>This file is an ini-file formatted list of <code>key = value</code> parameters.
+Environment variables can be replaced using <code>${VARIABLE_NAME}</code>. For example:</p>
+
+<pre><code>prefix = ${HOME}/.npm-packages</code></pre>
 
 <h3 id="Global-config-file">Global config file</h3>
 
 <p><code>$PREFIX/etc/npmrc</code> (or the <code>globalconfig</code> param, if set above):
-This file is an ini-file formatted list of <code>key = value</code> parameters</p>
+This file is an ini-file formatted list of <code>key = value</code> parameters.
+Environment variables can be replaced as above.</p>
 
 <h3 id="Built-in-config-file">Built-in config file</h3>
 
@@ -767,7 +771,7 @@ then answer &quot;no&quot; to any prompt.</p>
 
 <ul><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li></ul>
 </div>
-<p id="footer">config &mdash; npm@1.2.10</p>
+<p id="footer">config &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index c871d3d..019e656 100644 (file)
@@ -57,7 +57,7 @@ registry.</p>
 
 <ul><li><a href="../doc/ls.html">ls(1)</a></li><li><a href="../doc/update.html">update(1)</a></li><li><a href="../doc/install.html">install(1)</a></li></ul>
 </div>
-<p id="footer">dedupe &mdash; npm@1.2.10</p>
+<p id="footer">dedupe &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index dd98b4c..eab223d 100644 (file)
@@ -31,7 +31,7 @@ something like this:</p>
 
 <ul><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
 </div>
-<p id="footer">deprecate &mdash; npm@1.2.10</p>
+<p id="footer">deprecate &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 425826e..14eee84 100644 (file)
@@ -160,7 +160,7 @@ from a fresh checkout.</p>
 
 <ul><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/init.html">init(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
 </div>
-<p id="footer">developers &mdash; npm@1.2.10</p>
+<p id="footer">developers &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 62aac9a..b363efb 100644 (file)
@@ -86,7 +86,7 @@ an empty tarball, you&#39;re going to be evicted.</li></ol>
 
 <ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/owner.html">owner(1)</a></li></ul>
 </div>
-<p id="footer">disputes &mdash; npm@1.2.10</p>
+<p id="footer">disputes &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 7843a49..ba79884 100644 (file)
@@ -37,7 +37,7 @@ config param.</p>
 
 <ul><li><a href="../doc/view.html">view(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/json.html">json(1)</a></li></ul>
 </div>
-<p id="footer">docs &mdash; npm@1.2.10</p>
+<p id="footer">docs &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 74fd445..293a66a 100644 (file)
@@ -37,7 +37,7 @@ or <code>&quot;notepad&quot;</code> on Windows.</li><li>Type: path</li></ul>
 
 <ul><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/explore.html">explore(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
 </div>
-<p id="footer">edit &mdash; npm@1.2.10</p>
+<p id="footer">edit &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 47ef0a8..5577e85 100644 (file)
@@ -40,7 +40,7 @@ Windows</li><li>Type: path</li></ul>
 
 <ul><li><a href="../doc/submodule.html">submodule(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/edit.html">edit(1)</a></li><li><a href="../doc/rebuild.html">rebuild(1)</a></li><li><a href="../doc/build.html">build(1)</a></li><li><a href="../doc/install.html">install(1)</a></li></ul>
 </div>
-<p id="footer">explore &mdash; npm@1.2.10</p>
+<p id="footer">explore &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 9fe947e..81852a0 100644 (file)
@@ -78,6 +78,52 @@ program that uses it.</p>
 
 <p>npm will not help you do something that is known to be a bad idea.</p>
 
+<h2 id="node_modules-is-the-name-of-my-deity-s-arch-rival-and-a-Forbidden-Word-in-my-religion-Can-I-configure-npm-to-use-a-different-folder"><code>&quot;node_modules&quot;</code> is the name of my deity&#39;s arch-rival, and a Forbidden Word in my religion.  Can I configure npm to use a different folder?</h2>
+
+<p>No.  This will never happen.  This question comes up sometimes,
+because it seems silly from the outside that npm couldn&#39;t just be
+configured to put stuff somewhere else, and then npm could load them
+from there.  It&#39;s an arbitrary spelling choice, right?  What&#39;s the bg
+deal?</p>
+
+<p>At the time of this writing, the string <code>&#39;node_modules&#39;</code> appears 151
+times in 53 separate files in npm and node core (excluding tests and
+documentation).</p>
+
+<p>Some of these references are in node&#39;s built-in module loader.  Since
+npm is not involved <strong>at all</strong> at run-time, node itself would have to
+be configured to know where you&#39;ve decided to stick stuff.  Complexity
+hurdle #1.  Since the Node module system is locked, this cannot be
+changed, and is enough to kill this request.  But I&#39;ll continue, in
+deference to your deity&#39;s delicate feelings regarding spelling.</p>
+
+<p>Many of the others are in dependencies that npm uses, which are not
+necessarily tightly coupled to npm (in the sense that they do not read
+npm&#39;s configuration files, etc.)  Each of these would have to be
+configured to take the name of the <code>node_modules</code> folder as a
+parameter.  Complexity hurdle #2.</p>
+
+<p>Furthermore, npm has the ability to &quot;bundle&quot; dependencies by adding
+the dep names to the <code>&quot;bundledDependencies&quot;</code> list in package.json,
+which causes the folder to be included in the package tarball.  What
+if the author of a module bundles its dependencies, and they use a
+different spelling for <code>node_modules</code>?  npm would have to rename the
+folder at publish time, and then be smart enough to unpack it using
+your locally configured name.  Complexity hurdle #3.</p>
+
+<p>Furthermore, what happens when you <em>change</em> this name?  Fine, it&#39;s
+easy enough the first time, just rename the <code>node_modules</code> folders to
+<code>./blergyblerp/</code> or whatever name you choose.  But what about when you
+change it again?  npm doesn&#39;t currently track any state about past
+configuration settings, so this would be rather difficult to do
+properly.  It would have to track every previous value for this
+config, and always accept any of them, or else yesterday&#39;s install may
+be broken tomorrow.  Complexity hurdle #5.</p>
+
+<p>Never going to happen.  The folder is named <code>node_modules</code>.  It is
+written indelibly in the Node Way, handed down from the ancient times
+of Node 0.3.</p>
+
 <h2 id="Should-I-check-my-node_modules-folder-into-git">Should I check my <code>node_modules</code> folder into git?</h2>
 
 <p>Mikeal Rogers answered this question very well:</p>
@@ -250,7 +296,7 @@ There is not sufficient need to impose namespace rules on everyone.</p>
 
 <ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li></ul>
 </div>
-<p id="footer">faq &mdash; npm@1.2.10</p>
+<p id="footer">faq &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index c966c34..7870b3f 100644 (file)
@@ -205,7 +205,7 @@ cannot be found elsewhere.  See <code><a href="../doc/json.html">json(1)</a></co
 
 <ul><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/pack.html">pack(1)</a></li><li><a href="../doc/cache.html">cache(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li></ul>
 </div>
-<p id="footer">folders &mdash; npm@1.2.10</p>
+<p id="footer">folders &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index b26baa4..9bdd61b 100644 (file)
@@ -205,7 +205,7 @@ cannot be found elsewhere.  See <code><a href="../doc/json.html">json(1)</a></co
 
 <ul><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/pack.html">pack(1)</a></li><li><a href="../doc/cache.html">cache(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li></ul>
 </div>
-<p id="footer">global &mdash; npm@1.2.10</p>
+<p id="footer">global &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 9e17cf8..6343d4a 100644 (file)
@@ -38,7 +38,7 @@ where the terms were found in the documentation.</p>
 
 <ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/help.html">help(1)</a></li></ul>
 </div>
-<p id="footer">help-search &mdash; npm@1.2.10</p>
+<p id="footer">help-search &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index ffc2ac5..623bce6 100644 (file)
@@ -36,7 +36,7 @@ matches are equivalent to specifying a topic name.</p>
 
 <ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/README.html">README</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/help-search.html">help-search(1)</a></li><li><a href="../doc/index.html">index(1)</a></li></ul>
 </div>
-<p id="footer">help &mdash; npm@1.2.10</p>
+<p id="footer">help &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 049bf6f..c7e6af0 100644 (file)
 
 <p> Mark your favorite packages</p>
 
+<h2 id="npm-stars-1"><a href="../doc/stars.html">stars(1)</a></h2>
+
+<p> View packages marked as favorites</p>
+
 <h2 id="npm-start-1"><a href="../doc/start.html">start(1)</a></h2>
 
 <p> Start a package</p>
 
 <p> Display npm username</p>
 </div>
-<p id="footer">index &mdash; npm@1.2.10</p>
+<p id="footer">index &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 39519e3..b5ebffb 100644 (file)
@@ -29,7 +29,7 @@ without a really good reason to do so.</p>
 
 <ul><li><a href="https://github.com/isaacs/init-package-json">https://github.com/isaacs/init-package-json</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/version.html">version(1)</a></li></ul>
 </div>
-<p id="footer">init &mdash; npm@1.2.10</p>
+<p id="footer">init &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index f68eab5..1a16807 100644 (file)
@@ -136,7 +136,7 @@ affects a real use-case, it will be investigated.</p>
 
 <ul><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/update.html">update(1)</a></li><li><a href="../doc/link.html">link(1)</a></li><li><a href="../doc/rebuild.html">rebuild(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/build.html">build(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/tag.html">tag(1)</a></li><li><a href="../doc/rm.html">rm(1)</a></li><li><a href="../doc/shrinkwrap.html">shrinkwrap(1)</a></li></ul>
 </div>
-<p id="footer">install &mdash; npm@1.2.10</p>
+<p id="footer">install &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 22e5a37..5970718 100644 (file)
@@ -525,7 +525,7 @@ overridden.</p>
 
 <ul><li><a href="../doc/semver.html">semver(1)</a></li><li><a href="../doc/init.html">init(1)</a></li><li><a href="../doc/version.html">version(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/help.html">help(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/rm.html">rm(1)</a></li></ul>
 </div>
-<p id="footer">json &mdash; npm@1.2.10</p>
+<p id="footer">json &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 6d078e9..7249113 100644 (file)
@@ -58,7 +58,7 @@ installation target into your project&#39;s <code>node_modules</code> folder.</p
 
 <ul><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
 </div>
-<p id="footer">link &mdash; npm@1.2.10</p>
+<p id="footer">link &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index c522d88..bdd6323 100644 (file)
@@ -25,7 +25,7 @@ limit the results to only the paths to the packages named.  Note that
 nested packages will <em>also</em> show the paths to the specified packages.
 For example, running <code>npm ls promzard</code> in npm&#39;s source tree will show:</p>
 
-<pre><code>npm@1.2.10 /path/to/npm
+<pre><code>npm@1.2.11 /path/to/npm
 â””─┬ init-package-json@0.0.4
   â””── promzard@0.1.5</code></pre>
 
@@ -64,7 +64,7 @@ project.</p>
 
 <ul><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/link.html">link(1)</a></li><li><a href="../doc/prune.html">prune(1)</a></li><li><a href="../doc/outdated.html">outdated(1)</a></li><li><a href="../doc/update.html">update(1)</a></li></ul>
 </div>
-<p id="footer">ls &mdash; npm@1.2.10</p>
+<p id="footer">ls &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 501a4c7..09ff19a 100644 (file)
@@ -14,7 +14,7 @@
 
 <h2 id="VERSION">VERSION</h2>
 
-<p>1.2.10</p>
+<p>1.2.11</p>
 
 <h2 id="DESCRIPTION">DESCRIPTION</h2>
 
@@ -135,7 +135,7 @@ will no doubt tell you to put the output in a gist or email.</p>
 
 <ul><li><a href="../doc/help.html">help(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/README.html">README</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/index.html">index(1)</a></li><li><a href="../api/npm.html">npm(3)</a></li></ul>
 </div>
-<p id="footer">npm &mdash; npm@1.2.10</p>
+<p id="footer">npm &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index fbf9820..b00991b 100644 (file)
@@ -21,7 +21,7 @@ packages are currently outdated.</p>
 
 <ul><li><a href="../doc/update.html">update(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li></ul>
 </div>
-<p id="footer">outdated &mdash; npm@1.2.10</p>
+<p id="footer">outdated &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index f359fee..105dd16 100644 (file)
@@ -34,7 +34,7 @@ that is not implemented at this time.</p>
 
 <ul><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../doc/disputes.html">disputes(1)</a></li></ul>
 </div>
-<p id="footer">owner &mdash; npm@1.2.10</p>
+<p id="footer">owner &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index bb2ae8f..d386b81 100644 (file)
@@ -29,7 +29,7 @@ overwritten the second time.</p>
 
 <ul><li><a href="../doc/cache.html">cache(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
 </div>
-<p id="footer">pack &mdash; npm@1.2.10</p>
+<p id="footer">pack &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 3c1f9f5..49aff1a 100644 (file)
@@ -20,7 +20,7 @@
 
 <ul><li><a href="../doc/root.html">root(1)</a></li><li><a href="../doc/bin.html">bin(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
 </div>
-<p id="footer">prefix &mdash; npm@1.2.10</p>
+<p id="footer">prefix &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 8045149..e633dcf 100644 (file)
@@ -25,7 +25,7 @@ package&#39;s dependencies list.</p>
 
 <ul><li><a href="../doc/rm.html">rm(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/list.html">list(1)</a></li></ul>
 </div>
-<p id="footer">prune &mdash; npm@1.2.10</p>
+<p id="footer">prune &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 2cec4ba..2fbc9ce 100644 (file)
@@ -29,7 +29,7 @@ the registry.  Overwrites when the &quot;--force&quot; flag is set.</p>
 
 <ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../doc/owner.html">owner(1)</a></li><li><a href="../doc/deprecate.html">deprecate(1)</a></li><li><a href="../doc/tag.html">tag(1)</a></li></ul>
 </div>
-<p id="footer">publish &mdash; npm@1.2.10</p>
+<p id="footer">publish &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index f3780da..3f62305 100644 (file)
@@ -25,7 +25,7 @@ the new binary.</p>
 
 <ul><li><a href="../doc/build.html">build(1)</a></li><li><a href="../doc/install.html">install(1)</a></li></ul>
 </div>
-<p id="footer">rebuild &mdash; npm@1.2.10</p>
+<p id="footer">rebuild &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 0ce8ce6..de04169 100644 (file)
@@ -95,7 +95,7 @@ ask for help on the <a href="mailto:npm-@googlegroups.com">npm-@googlegroups.com
 
 <ul><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/disputes.html">disputes(1)</a></li></ul>
 </div>
-<p id="footer">registry &mdash; npm@1.2.10</p>
+<p id="footer">registry &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 858e162..e575a94 100644 (file)
@@ -58,7 +58,7 @@ modules.  To track those down, you can do the following:</p>
 
 <ul><li><a href="../doc/README.html">README</a></li><li><a href="../doc/rm.html">rm(1)</a></li><li><a href="../doc/prune.html">prune(1)</a></li></ul>
 </div>
-<p id="footer">removing-npm &mdash; npm@1.2.10</p>
+<p id="footer">removing-npm &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 27da194..b9b83d7 100644 (file)
@@ -24,7 +24,7 @@ the &quot;start&quot; script.</p>
 
 <ul><li><a href="../doc/run-script.html">run-script(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/test.html">test(1)</a></li><li><a href="../doc/start.html">start(1)</a></li><li><a href="../doc/stop.html">stop(1)</a></li></ul>
 </div>
-<p id="footer">restart &mdash; npm@1.2.10</p>
+<p id="footer">restart &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 24c398c..97331bf 100644 (file)
@@ -22,7 +22,7 @@ on its behalf.</p>
 
 <ul><li><a href="../doc/prune.html">prune(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
 </div>
-<p id="footer">rm &mdash; npm@1.2.10</p>
+<p id="footer">rm &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 8a48ad7..165e337 100644 (file)
@@ -20,7 +20,7 @@
 
 <ul><li><a href="../doc/prefix.html">prefix(1)</a></li><li><a href="../doc/bin.html">bin(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
 </div>
-<p id="footer">root &mdash; npm@1.2.10</p>
+<p id="footer">root &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index bcbbcac..0d9548d 100644 (file)
@@ -23,7 +23,7 @@ called directly, as well.</p>
 
 <ul><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/test.html">test(1)</a></li><li><a href="../doc/start.html">start(1)</a></li><li><a href="../doc/restart.html">restart(1)</a></li><li><a href="../doc/stop.html">stop(1)</a></li></ul>
 </div>
-<p id="footer">run-script &mdash; npm@1.2.10</p>
+<p id="footer">run-script &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 9aa1f5b..aade7cf 100644 (file)
@@ -218,7 +218,7 @@ will sudo the npm command in question.</li></ul>
 
 <ul><li><a href="../doc/run-script.html">run-script(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/install.html">install(1)</a></li></ul>
 </div>
-<p id="footer">scripts &mdash; npm@1.2.10</p>
+<p id="footer">scripts &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 39885c5..8a201ae 100644 (file)
@@ -24,7 +24,7 @@ expression characters must be escaped or quoted in most shells.)</p>
 
 <ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/view.html">view(1)</a></li></ul>
 </div>
-<p id="footer">search &mdash; npm@1.2.10</p>
+<p id="footer">search &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 0c462e6..410695d 100644 (file)
@@ -104,7 +104,7 @@ that satisfies the range, or null if none of them do.</li></ul>
 
 <ul><li><a href="../doc/json.html">json(1)</a></li></ul>
 </div>
-<p id="footer">semver &mdash; npm@1.2.10</p>
+<p id="footer">semver &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 6d6760b..efed371 100644 (file)
@@ -169,7 +169,7 @@ versions.</p>
 
 <ul><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/list.html">list(1)</a></li></ul>
 </div>
-<p id="footer">shrinkwrap &mdash; npm@1.2.10</p>
+<p id="footer">shrinkwrap &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 007f8bf..7f7cb78 100644 (file)
@@ -26,7 +26,7 @@ a vaguely positive way to show that you care.</p>
 
 <ul><li><a href="../doc/view.html">view(1)</a></li><li><a href="../doc/whoami.html">whoami(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li></ul>
 </div>
-<p id="footer">star &mdash; npm@1.2.10</p>
+<p id="footer">star &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/stars.html b/deps/npm/html/doc/stars.html
new file mode 100644 (file)
index 0000000..a3204e6
--- /dev/null
@@ -0,0 +1,60 @@
+<!doctype html>
+<html>
+  <title>stars</title>
+  <meta http-equiv="content-type" value="text/html;utf-8">
+  <link rel="stylesheet" type="text/css" href="../static/style.css">
+
+  <body>
+    <div id="wrapper">
+<h1><a href="../doc/stars.html">stars</a></h1> <p>View packages marked as favorites</p>
+
+<h2 id="SYNOPSIS">SYNOPSIS</h2>
+
+<pre><code>npm stars
+npm stars [username]</code></pre>
+
+<h2 id="DESCRIPTION">DESCRIPTION</h2>
+
+<p>If you have starred a lot of neat things and want to find them again
+quickly this command lets you do just that.</p>
+
+<p>You may also want to see your friend&#39;s favorite packages, in this case
+you will most certainly enjoy this command.</p>
+
+<h2 id="SEE-ALSO">SEE ALSO</h2>
+
+<ul><li><a href="../doc/star.html">star(1)</a></li><li><a href="../doc/view.html">view(1)</a></li><li><a href="../doc/whoami.html">whoami(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li></ul>
+</div>
+<p id="footer">stars &mdash; npm@1.2.11</p>
+<script>
+;(function () {
+var wrapper = document.getElementById("wrapper")
+var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
+  .filter(function (el) {
+    return el.parentNode === wrapper
+        && el.tagName.match(/H[1-6]/)
+        && el.id
+  })
+var l = 2
+  , toc = document.createElement("ul")
+toc.innerHTML = els.map(function (el) {
+  var i = el.tagName.charAt(1)
+    , out = ""
+  while (i > l) {
+    out += "<ul>"
+    l ++
+  }
+  while (i < l) {
+    out += "</ul>"
+    l --
+  }
+  out += "<li><a href='#" + el.id + "'>" +
+    ( el.innerText || el.text || el.innerHTML)
+    + "</a>"
+  return out
+}).join("\n")
+toc.id = "toc"
+document.body.appendChild(toc)
+})()
+</script>
+</body></html>
index 3e6aa1c..4a42ee1 100644 (file)
@@ -20,7 +20,7 @@
 
 <ul><li><a href="../doc/run-script.html">run-script(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/test.html">test(1)</a></li><li><a href="../doc/restart.html">restart(1)</a></li><li><a href="../doc/stop.html">stop(1)</a></li></ul>
 </div>
-<p id="footer">start &mdash; npm@1.2.10</p>
+<p id="footer">start &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 115a980..98a4b5c 100644 (file)
@@ -20,7 +20,7 @@
 
 <ul><li><a href="../doc/run-script.html">run-script(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/test.html">test(1)</a></li><li><a href="../doc/start.html">start(1)</a></li><li><a href="../doc/restart.html">restart(1)</a></li></ul>
 </div>
-<p id="footer">stop &mdash; npm@1.2.10</p>
+<p id="footer">stop &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index a70b4d0..fdb7797 100644 (file)
@@ -33,7 +33,7 @@ dependencies into the submodule folder.</p>
 
 <ul><li><a href="../doc/json.html">json(1)</a></li><li>git help submodule</li></ul>
 </div>
-<p id="footer">submodule &mdash; npm@1.2.10</p>
+<p id="footer">submodule &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 28a38fa..a7290ca 100644 (file)
@@ -21,7 +21,7 @@
 
 <ul><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
 </div>
-<p id="footer">tag &mdash; npm@1.2.10</p>
+<p id="footer">tag &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 9428eb2..297062f 100644 (file)
@@ -23,7 +23,7 @@ true.</p>
 
 <ul><li><a href="../doc/run-script.html">run-script(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/start.html">start(1)</a></li><li><a href="../doc/restart.html">restart(1)</a></li><li><a href="../doc/stop.html">stop(1)</a></li></ul>
 </div>
-<p id="footer">test &mdash; npm@1.2.10</p>
+<p id="footer">test &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index c81e946..1632ff2 100644 (file)
@@ -22,7 +22,7 @@ on its behalf.</p>
 
 <ul><li><a href="../doc/prune.html">prune(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
 </div>
-<p id="footer">uninstall &mdash; npm@1.2.10</p>
+<p id="footer">uninstall &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index e9a8ec0..92636e1 100644 (file)
@@ -34,7 +34,7 @@ the root package entry is removed from the registry entirely.</p>
 
 <ul><li><a href="../doc/deprecate.html">deprecate(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../doc/owner.html">owner(1)</a></li></ul>
 </div>
-<p id="footer">unpublish &mdash; npm@1.2.10</p>
+<p id="footer">unpublish &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 1f134e3..9652a53 100644 (file)
@@ -10,7 +10,7 @@
 
 <h2 id="SYNOPSIS">SYNOPSIS</h2>
 
-<pre><code>npm update [&lt;name&gt; [&lt;name&gt; ...]]</code></pre>
+<pre><code>npm update [-g] [&lt;name&gt; [&lt;name&gt; ...]]</code></pre>
 
 <h2 id="DESCRIPTION">DESCRIPTION</h2>
 
 
 <p>It will also install missing packages.</p>
 
+<p>If the <code>-g</code> flag is specified, this command will update globally installed packages.
+If no package name is specified, all packages in the specified location (global or local) will be updated.</p>
+
 <h2 id="SEE-ALSO">SEE ALSO</h2>
 
 <ul><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/outdated.html">outdated(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/list.html">list(1)</a></li></ul>
 </div>
-<p id="footer">update &mdash; npm@1.2.10</p>
+<p id="footer">update &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index d7fbfaa..953db5e 100644 (file)
@@ -34,13 +34,22 @@ resulting version number.  For example:</p>
 
 <p>If the <code>sign-git-tag</code> config is set, then the tag will be signed using
 the <code>-s</code> flag to git.  Note that you must have a default GPG key set up
-in your git config for this to work properly.</p>
+in your git config for this to work properly.  For example:</p>
+
+<pre><code>$ npm config set sign-git-tag true
+$ npm version patch
+
+You need a passphrase to unlock the secret key for
+user: &quot;isaacs (http://blog.izs.me/) &lt;i@izs.me&gt;&quot;
+2048-bit RSA key, ID 6C481CF6, created 2010-08-31
+
+Enter passphrase:</code></pre>
 
 <h2 id="SEE-ALSO">SEE ALSO</h2>
 
 <ul><li><a href="../doc/init.html">init(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/semver.html">semver(1)</a></li></ul>
 </div>
-<p id="footer">version &mdash; npm@1.2.10</p>
+<p id="footer">version &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index f09cd1b..1a36e11 100644 (file)
@@ -90,7 +90,7 @@ the field name.</p>
 
 <ul><li><a href="../doc/search.html">search(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/docs.html">docs(1)</a></li></ul>
 </div>
-<p id="footer">view &mdash; npm@1.2.10</p>
+<p id="footer">view &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 505bc33..0b07228 100644 (file)
@@ -20,7 +20,7 @@
 
 <ul><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li></ul>
 </div>
-<p id="footer">whoami &mdash; npm@1.2.10</p>
+<p id="footer">whoami &mdash; npm@1.2.11</p>
 <script>
 ;(function () {
 var wrapper = document.getElementById("wrapper")
index 5e92ef5..a7a7a42 100644 (file)
@@ -139,6 +139,7 @@ function read (name, ver, forceBypass, cb) {
   }
 
   readJson(jsonFile, function (er, data) {
+    er = needVersion(er, data)
     if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
     if (er) return addNamed(name, ver, c)
     deprCheck(data)
@@ -282,9 +283,11 @@ function fetchAndShaCheck (u, tmp, shasum, cb) {
       log.error("fetch failed", u)
       return cb(er, response)
     }
-    if (!shasum) return cb()
+    if (!shasum) return cb(null, response)
     // validate that the url we just downloaded matches the expected shasum.
-    sha.check(tmp, shasum, cb)
+    sha.check(tmp, shasum, function (er) {
+      return cb(er, response, shasum)
+    })
   })
 }
 
@@ -324,9 +327,9 @@ function addRemoteTarball (u, shasum, name, cb_) {
     })
   })
 
-  function done (er) {
+  function done (er, resp, shasum) {
     if (er) return cb(er)
-    addLocalTarball(tmp, name, cb)
+    addLocalTarball(tmp, name, shasum, cb)
   }
 }
 
@@ -342,7 +345,7 @@ function addRemoteTarball_(u, tmp, shasum, cb) {
   operation.attempt(function (currentAttempt) {
     log.info("retry", "fetch attempt " + currentAttempt
       + " at " + (new Date()).toLocaleTimeString())
-    fetchAndShaCheck(u, tmp, shasum, function (er, response) {
+    fetchAndShaCheck(u, tmp, shasum, function (er, response, shasum) {
       // Only retry on 408, 5xx or no `response`.
       var sc = response && response.statusCode
       var statusRetry = !sc || (sc === 408 || sc >= 500)
@@ -350,7 +353,7 @@ function addRemoteTarball_(u, tmp, shasum, cb) {
         log.info("retry", "will retry, error on last attempt: " + er)
         return
       }
-      cb(er)
+      cb(er, response, shasum)
     })
   })
 }
@@ -714,6 +717,7 @@ function addNameVersion (name, ver, data, cb) {
       if (!er) readJson( path.join( npm.cache, name, ver
                                   , "package", "package.json" )
                        , function (er, data) {
+          er = needVersion(er, data)
           if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
           if (er) return fetchit()
           return cb(null, data)
@@ -732,6 +736,11 @@ function addNameVersion (name, ver, data, cb) {
       tb.protocol = url.parse(npm.config.get("registry")).protocol
       delete tb.href
       tb = url.format(tb)
+      // only add non-shasum'ed packages if --forced.
+      // only ancient things would lack this for good reasons nowadays.
+      if (!dist.shasum && !npm.config.get("force")) {
+        return cb(new Error("package lacks shasum"))
+      }
       return addRemoteTarball( tb
                              , dist.shasum
                              , name+"-"+ver
@@ -791,16 +800,18 @@ function maybeGithub (p, name, er, cb) {
   })
 }
 
-function addLocalTarball (p, name, cb_) {
+function addLocalTarball (p, name, shasum, cb_) {
+  if (typeof cb_ !== "function") cb_ = shasum, shasum = null
   if (typeof cb_ !== "function") cb_ = name, name = ""
   // if it's a tar, and not in place,
   // then unzip to .tmp, add the tmp folder, and clean up tmp
-  if (p.indexOf(npm.tmp) === 0) return addTmpTarball(p, name, cb_)
+  if (p.indexOf(npm.tmp) === 0)
+    return addTmpTarball(p, name, shasum, cb_)
 
   if (p.indexOf(npm.cache) === 0) {
     if (path.basename(p) !== "package.tgz") return cb_(new Error(
       "Not a valid cache tarball name: "+p))
-    return addPlacedTarball(p, name, cb_)
+    return addPlacedTarball(p, name, shasum, cb_)
   }
 
   function cb (er, data) {
@@ -827,7 +838,7 @@ function addLocalTarball (p, name, cb_) {
       log.verbose("chmod", tmp, npm.modes.file.toString(8))
       fs.chmod(tmp, npm.modes.file, function (er) {
         if (er) return cb(er)
-        addTmpTarball(tmp, name, cb)
+        addTmpTarball(tmp, name, shasum, cb)
       })
     })
     from.pipe(to)
@@ -890,15 +901,74 @@ function makeCacheDir (cb) {
 
 
 
-function addPlacedTarball (p, name, cb) {
+function addPlacedTarball (p, name, shasum, cb) {
   if (!cb) cb = name, name = ""
   getCacheStat(function (er, cs) {
     if (er) return cb(er)
-    return addPlacedTarball_(p, name, cs.uid, cs.gid, cb)
+    return addPlacedTarball_(p, name, cs.uid, cs.gid, shasum, cb)
   })
 }
 
-function addPlacedTarball_ (p, name, uid, gid, cb) {
+// Resolved sum is the shasum from the registry dist object, but
+// *not* necessarily the shasum of this tarball, because for stupid
+// historical reasons, npm re-packs each package an extra time through
+// a temp directory, so all installed packages are actually built with
+// *this* version of npm, on this machine.
+//
+// Once upon a time, this meant that we could change package formats
+// around and fix junk that might be added by incompatible tar
+// implementations.  Then, for a while, it was a way to correct bs
+// added by bugs in our own tar implementation.  Now, it's just
+// garbage, but cleaning it up is a pain, and likely to cause issues
+// if anything is overlooked, so it's not high priority.
+//
+// If you're bored, and looking to make npm go faster, and you've
+// already made it this far in this file, here's a better methodology:
+//
+// cache.add should really be cache.place.  That is, it should take
+// a set of arguments like it does now, but then also a destination
+// folder.
+//
+// cache.add('foo@bar', '/path/node_modules/foo', cb)
+//
+// 1. Resolve 'foo@bar' to some specific:
+//   - git url
+//   - local folder
+//   - local tarball
+//   - tarball url
+// 2. If resolved through the registry, then pick up the dist.shasum
+// along the way.
+// 3. Acquire request() stream fetching bytes: FETCH
+// 4. FETCH.pipe(tar unpack stream to dest)
+// 5. FETCH.pipe(shasum generator)
+// When the tar and shasum streams both finish, make sure that the
+// shasum matches dist.shasum, and if not, clean up and bail.
+//
+// publish(cb)
+//
+// 1. read package.json
+// 2. get root package object (for rev, and versions)
+// 3. update root package doc with version info
+// 4. remove _attachments object
+// 5. remove versions object
+// 5. jsonify, remove last }
+// 6. get stream: registry.put(/package)
+// 7. write trailing-}-less JSON
+// 8. write "_attachments":
+// 9. JSON.stringify(attachments), remove trailing }
+// 10. Write start of attachments (stubs)
+// 11. JSON(filename)+':{"type":"application/octet-stream","data":"'
+// 12. acquire tar packing stream, PACK
+// 13. PACK.pipe(PUT)
+// 14. PACK.pipe(shasum generator)
+// 15. when PACK finishes, get shasum
+// 16. PUT.write('"}},') (finish _attachments
+// 17. update "versions" object with current package version
+// (including dist.shasum and dist.tarball)
+// 18. write '"versions":' + JSON(versions)
+// 19. write '}}' (versions, close main doc)
+
+function addPlacedTarball_ (p, name, uid, gid, resolvedSum, cb) {
   // now we know it's in place already as .cache/name/ver/package.tgz
   // unpack to .cache/name/ver/package/, read the package.json,
   // and fire cb with the json data.
@@ -936,13 +1006,15 @@ function addPlacedTarball_ (p, name, uid, gid, cb) {
           return cb(er)
         }
         readJson(path.join(folder, "package.json"), function (er, data) {
+          er = needVersion(er, data)
           if (er) {
             log.error("addPlacedTarball", "Couldn't read json in %j"
                      , folder)
             return cb(er)
           }
+
           data.dist = data.dist || {}
-          if (shasum) data.dist.shasum = shasum
+          data.dist.shasum = shasum
           deprCheck(data)
           asyncMap([p], function (f, cb) {
             log.verbose("chmod", f, npm.modes.file.toString(8))
@@ -970,13 +1042,17 @@ function addPlacedTarball_ (p, name, uid, gid, cb) {
   }
 }
 
-function addLocalDirectory (p, name, cb) {
+// At this point, if shasum is set, it's something that we've already
+// read and checked.  Just stashing it in the data at this point.
+function addLocalDirectory (p, name, shasum, cb) {
+  if (typeof cb !== "function") cb = shasum, shasum = ""
   if (typeof cb !== "function") cb = name, name = ""
   // if it's a folder, then read the package.json,
   // tar it to the proper place, and add the cache tar
   if (p.indexOf(npm.cache) === 0) return cb(new Error(
     "Adding a cache directory to the cache will make the world implode."))
   readJson(path.join(p, "package.json"), function (er, data) {
+    er = needVersion(er, data)
     if (er) return cb(er)
     deprCheck(data)
     var random = Date.now() + "-" + Math.random()
@@ -1004,7 +1080,7 @@ function addLocalDirectory (p, name, cb) {
 
           chownr(made || tgz, cs.uid, cs.gid, function (er) {
             if (er) return cb(er)
-            addLocalTarball(tgz, name, cb)
+            addLocalTarball(tgz, name, shasum, cb)
           })
         })
       })
@@ -1012,7 +1088,7 @@ function addLocalDirectory (p, name, cb) {
   })
 }
 
-function addTmpTarball (tgz, name, cb) {
+function addTmpTarball (tgz, name, shasum, cb) {
   if (!cb) cb = name, name = ""
   getCacheStat(function (er, cs) {
     if (er) return cb(er)
@@ -1024,7 +1100,7 @@ function addTmpTarball (tgz, name, cb) {
       if (er) {
         return cb(er)
       }
-      addLocalDirectory(path.resolve(contents, "package"), name, cb)
+      addLocalDirectory(path.resolve(contents, "package"), name, shasum, cb)
     })
   })
 }
@@ -1101,3 +1177,9 @@ function unlock (u, cb) {
   myLocks[lf] = false
   lockFile.unlock(lockFileName(u), cb)
 }
+
+function needVersion(er, data) {
+  return er ? er
+       : (data && !data.version) ? new Error("No version provided")
+       : null
+}
index 5f97dc4..9f63c74 100644 (file)
@@ -649,7 +649,7 @@ function targetResolver (where, context, deps) {
     }
 
     if (wrap) {
-      name = what.split(/@/).shift()
+      var name = what.split(/@/).shift()
       if (wrap[name]) {
         var wrapTarget = readWrap(wrap[name])
         what = name + "@" + wrapTarget
index da39eee..2028b34 100644 (file)
@@ -127,6 +127,7 @@ var commandCache = {}
 
               , "publish"
               , "star"
+              , "stars"
               , "tag"
               , "adduser"
               , "unpublish"
@@ -242,6 +243,9 @@ npm.load = function (cli, cb_) {
 
   function cb (er) {
     if (loadErr) return
+    if (npm.config.get("force")) {
+      log.warn("using --force", "I sure hope you know what you are doing.")
+    }
     npm.config.loaded = true
     loaded = true
     loadCb(loadErr = er)
index 8de09e5..62d7fb9 100644 (file)
@@ -32,6 +32,7 @@ function publish (args, isRetry, cb) {
   var arg = args[0]
   // if it's a local folder, then run the prepublish there, first.
   readJson(path.resolve(arg, "package.json"), function (er, data) {
+    er = needVersion(er, data)
     if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
     // error is ok.  could be publishing a url or tarball
     // however, that means that we will not have automatically run
@@ -105,3 +106,9 @@ function publish_ (arg, data, isRetry, cachedir, cb) {
     cb()
   })
 }
+
+function needVersion(er, data) {
+  return er ? er
+       : (data && !data.version) ? new Error("No version provided")
+       : null
+}
diff --git a/deps/npm/lib/stars.js b/deps/npm/lib/stars.js
new file mode 100644 (file)
index 0000000..74841f2
--- /dev/null
@@ -0,0 +1,27 @@
+module.exports = stars
+
+stars.usage = "npm stars [username]"
+
+var npm = require("./npm.js")
+  , registry = npm.registry
+  , log = require("npmlog")
+
+function stars (args, cb) {
+  var name = args.length === 1 ? args[0] : npm.config.get("username")
+  registry.stars(name, showstars)
+
+  function showstars (er, data) {
+    if (er) {
+      return cb(er)
+    }
+
+    if (data.rows.length === 0) {
+      log.warn('stars', 'user has not starred any packages.')
+    } else {
+      data.rows.forEach(function(a) {
+        console.log(a.value)
+      })
+    }
+    cb()
+  }
+}
index 51394f1..88ce742 100644 (file)
@@ -156,9 +156,13 @@ function errorHandler (er) {
   case "EPUBLISHCONFLICT":
     er.code = "EPUBLISHCONFLICT"
     log.error("publish fail", ["Cannot publish over existing version."
-              ,"Bump the 'version' field, set the --force flag, or"
-              ,"    npm unpublish '"+er.pkgid+"'"
-              ,"and try again"
+              ,"Update the 'version' field in package.json and try again."
+              ,""
+              ,"If the previous version was published in error, see:"
+              ,"    npm help unpublish"
+              ,""
+              ,"To automatically increment version numbers, see:"
+              ,"    npm help version"
               ].join("\n"))
     break
 
index d3cd83a..a421201 100644 (file)
@@ -5,16 +5,17 @@ var fs = require("graceful-fs")
   , binding
 
 try { binding = process.binding("crypto") }
-catch (e) { binding = null }
+catch (e) {
+  var er = new Error( "crypto binding not found.\n"
+                    + "Please build node with openssl.\n"
+                    + e.message )
+  throw er
+}
 
 exports.check = check
 exports.get = get
 
 function check (file, sum, cb) {
-  if (!binding) {
-    log.warn("shasum", "crypto binding not found. Cannot verify shasum.")
-    return cb()
-  }
   get(file, function (er, actual) {
     if (er) {
       log.error("shasum", "error getting shasum")
@@ -30,10 +31,6 @@ function check (file, sum, cb) {
 }
 
 function get (file, cb) {
-  if (!binding) {
-    log.warn("shasum", "crypto binding not found. Cannot verify shasum.")
-    return cb()
-  }
   var h = crypto.createHash("sha1")
     , s = fs.createReadStream(file)
     , errState = null
index 0269570..df6167b 100644 (file)
@@ -40,10 +40,21 @@ work the same\.
 .
 .P
 This file is an ini\-file formatted list of \fBkey = value\fR parameters\.
+Environment variables can be replaced using \fB${VARIABLE_NAME}\fR\|\. For example:
+.
+.IP "" 4
+.
+.nf
+prefix = ${HOME}/\.npm\-packages
+.
+.fi
+.
+.IP "" 0
 .
 .SS "Global config file"
 \fB$PREFIX/etc/npmrc\fR (or the \fBglobalconfig\fR param, if set above):
-This file is an ini\-file formatted list of \fBkey = value\fR parameters
+This file is an ini\-file formatted list of \fBkey = value\fR parameters\.
+Environment variables can be replaced as above\.
 .
 .SS "Built\-in config file"
 \fBpath/to/npm/itself/npmrc\fR
index 256e0ba..bc31a41 100644 (file)
@@ -89,6 +89,56 @@ Write your own package manager, then\.  It\'s not that hard\.
 .P
 npm will not help you do something that is known to be a bad idea\.
 .
+.SH "<code>&quot;node_modules&quot;</code>"
+No\.  This will never happen\.  This question comes up sometimes,
+because it seems silly from the outside that npm couldn\'t just be
+configured to put stuff somewhere else, and then npm could load them
+from there\.  It\'s an arbitrary spelling choice, right?  What\'s the bg
+deal?
+.
+.P
+At the time of this writing, the string \fB\'node_modules\'\fR appears 151
+times in 53 separate files in npm and node core (excluding tests and
+documentation)\.
+.
+.P
+Some of these references are in node\'s built\-in module loader\.  Since
+npm is not involved \fBat all\fR at run\-time, node itself would have to
+be configured to know where you\'ve decided to stick stuff\.  Complexity
+hurdle #1\.  Since the Node module system is locked, this cannot be
+changed, and is enough to kill this request\.  But I\'ll continue, in
+deference to your deity\'s delicate feelings regarding spelling\.
+.
+.P
+Many of the others are in dependencies that npm uses, which are not
+necessarily tightly coupled to npm (in the sense that they do not read
+npm\'s configuration files, etc\.)  Each of these would have to be
+configured to take the name of the \fBnode_modules\fR folder as a
+parameter\.  Complexity hurdle #2\.
+.
+.P
+Furthermore, npm has the ability to "bundle" dependencies by adding
+the dep names to the \fB"bundledDependencies"\fR list in package\.json,
+which causes the folder to be included in the package tarball\.  What
+if the author of a module bundles its dependencies, and they use a
+different spelling for \fBnode_modules\fR?  npm would have to rename the
+folder at publish time, and then be smart enough to unpack it using
+your locally configured name\.  Complexity hurdle #3\.
+.
+.P
+Furthermore, what happens when you \fIchange\fR this name?  Fine, it\'s
+easy enough the first time, just rename the \fBnode_modules\fR folders to \fB\|\./blergyblerp/\fR or whatever name you choose\.  But what about when you
+change it again?  npm doesn\'t currently track any state about past
+configuration settings, so this would be rather difficult to do
+properly\.  It would have to track every previous value for this
+config, and always accept any of them, or else yesterday\'s install may
+be broken tomorrow\.  Complexity hurdle #5\.
+.
+.P
+Never going to happen\.  The folder is named \fBnode_modules\fR\|\.  It is
+written indelibly in the Node Way, handed down from the ancient times
+of Node 0\.3\.
+.
 .SH "Should I check my "
 Mikeal Rogers answered this question very well:
 .
index 2a6bcfe..ed6f1d9 100644 (file)
 .SH "npm help star"
  Mark your favorite packages
 .
+.SH "npm help stars"
+ View packages marked as favorites
+.
 .SH "npm help start"
  Start a package
 .
index 1e224cd..fadb701 100644 (file)
@@ -29,7 +29,7 @@ For example, running \fBnpm ls promzard\fR in npm\'s source tree will show:
 .IP "" 4
 .
 .nf
-npm@1.2.10 /path/to/npm
+npm@1.2.11 /path/to/npm
 â””─┬ init\-package\-json@0\.0\.4
   â””── promzard@0\.1\.5
 .
index dd7de70..b0bc36d 100644 (file)
@@ -14,7 +14,7 @@ npm <command> [args]
 .fi
 .
 .SH "VERSION"
-1.2.10
+1.2.11
 .
 .SH "DESCRIPTION"
 npm is the package manager for the Node JavaScript platform\.  It puts
diff --git a/deps/npm/man/man1/stars.1 b/deps/npm/man/man1/stars.1
new file mode 100644 (file)
index 0000000..fe0095d
--- /dev/null
@@ -0,0 +1,40 @@
+.\" Generated with Ronnjs 0.3.8
+.\" http://github.com/kapouer/ronnjs/
+.
+.TH "NPM\-STARS" "1" "February 2013" "" ""
+.
+.SH "NAME"
+\fBnpm-stars\fR \-\- View packages marked as favorites
+.
+.SH "SYNOPSIS"
+.
+.nf
+npm stars
+npm stars [username]
+.
+.fi
+.
+.SH "DESCRIPTION"
+If you have starred a lot of neat things and want to find them again
+quickly this command lets you do just that\.
+.
+.P
+You may also want to see your friend\'s favorite packages, in this case
+you will most certainly enjoy this command\.
+.
+.SH "SEE ALSO"
+.
+.IP "\(bu" 4
+npm help star
+.
+.IP "\(bu" 4
+npm help view
+.
+.IP "\(bu" 4
+npm help whoami
+.
+.IP "\(bu" 4
+npm help adduser
+.
+.IP "" 0
+
index 58a073b..e935863 100644 (file)
@@ -9,7 +9,7 @@
 .SH "SYNOPSIS"
 .
 .nf
-npm update [<name> [<name> \.\.\.]]
+npm update [\-g] [<name> [<name> \.\.\.]]
 .
 .fi
 .
@@ -20,6 +20,10 @@ This command will update all the packages listed to the latest version
 .P
 It will also install missing packages\.
 .
+.P
+If the \fB\-g\fR flag is specified, this command will update globally installed packages\.
+If no package name is specified, all packages in the specified location (global or local) will be updated\.
+.
 .SH "SEE ALSO"
 .
 .IP "\(bu" 4
index 227aade..85dd384 100644 (file)
@@ -44,7 +44,21 @@ npm version patch \-m "Upgrade to %s for reasons"
 .P
 If the \fBsign\-git\-tag\fR config is set, then the tag will be signed using
 the \fB\-s\fR flag to git\.  Note that you must have a default GPG key set up
-in your git config for this to work properly\.
+in your git config for this to work properly\.  For example:
+.
+.IP "" 4
+.
+.nf
+$ npm config set sign\-git\-tag true
+$ npm version patch
+You need a passphrase to unlock the secret key for
+user: "isaacs (http://blog\.izs\.me/) <i@izs\.me>"
+2048\-bit RSA key, ID 6C481CF6, created 2010\-08\-31
+Enter passphrase:
+.
+.fi
+.
+.IP "" 0
 .
 .SH "SEE ALSO"
 .
index e836d7f..06d0090 100644 (file)
@@ -21,7 +21,7 @@ npm\.load([configObject,] function (er, npm) {
 .fi
 .
 .SH "VERSION"
-1.2.10
+1.2.11
 .
 .SH "DESCRIPTION"
 This is the API documentation for npm\.
index d241e7c..891c883 100644 (file)
@@ -325,9 +325,7 @@ Glob.prototype._process = function (pattern, depth, index, cb_) {
         if (exists) {
           if (prefix && isAbsolute(prefix) && !this.nomount) {
            if (prefix.charAt(0) === "/") {
-             console.error('JOIN 0', this.root, prefix)
               prefix = path.join(this.root, prefix)
-             console.error('JOIN 1', this.root, prefix)
            } else {
              prefix = path.resolve(this.root, prefix)
            }
@@ -364,9 +362,7 @@ Glob.prototype._process = function (pattern, depth, index, cb_) {
   if (prefix === null) read = "."
   else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) {
     if (!prefix || !isAbsolute(prefix)) {
-           console.error('JOIN 1', "/", prefix)
       prefix = path.join("/", prefix)
-           console.error('JOIN 2', "/", prefix)
     }
     read = prefix = path.resolve(prefix)
 
@@ -444,9 +440,7 @@ Glob.prototype._process = function (pattern, depth, index, cb_) {
           else e = prefix + e
         }
         if (e.charAt(0) === "/" && !this.nomount) {
-           console.error('JOIN 3', this.root, e)
           e = path.join(this.root, e)
-           console.error('JOIN 4', this.root, e)
         }
 
         if (process.platform === "win32")
@@ -481,9 +475,7 @@ Glob.prototype._stat = function (f, cb) {
   assert(this instanceof Glob)
   var abs = f
   if (f.charAt(0) === "/") {
-           console.error('JOIN 5', this.root, f)
     abs = path.join(this.root, f)
-           console.error('JOIN 6', this.root, f)
   } else if (this.changedCwd) {
     abs = path.resolve(this.cwd, f)
   }
@@ -541,9 +533,7 @@ Glob.prototype._readdir = function (f, cb) {
   assert(this instanceof Glob)
   var abs = f
   if (f.charAt(0) === "/") {
-           console.error('JOIN 5', this.root, f)
     abs = path.join(this.root, f)
-           console.error('JOIN 5', abs)
   } else if (isAbsolute(f)) {
     abs = f
   } else if (this.changedCwd) {
index c1fe087..c4b0d3b 100644 (file)
@@ -6,7 +6,7 @@
   },
   "name": "glob",
   "description": "a little globber",
-  "version": "3.1.19",
+  "version": "3.1.20",
   "repository": {
     "type": "git",
     "url": "git://github.com/isaacs/node-glob.git"
   "license": "BSD",
   "readme": "# Glob\n\nThis is a glob implementation in JavaScript.  It uses the `minimatch`\nlibrary to do its matching.\n\n## Attention: node-glob users!\n\nThe API has changed dramatically between 2.x and 3.x. This library is\nnow 100% JavaScript, and the integer flags have been replaced with an\noptions object.\n\nAlso, there's an event emitter class, proper tests, and all the other\nthings you've come to expect from node modules.\n\nAnd best of all, no compilation!\n\n## Usage\n\n```javascript\nvar glob = require(\"glob\")\n\n// options is optional\nglob(\"**/*.js\", options, function (er, files) {\n  // files is an array of filenames.\n  // If the `nonull` option is set, and nothing\n  // was found, then files is [\"**/*.js\"]\n  // er is an error object or null.\n})\n```\n\n## Features\n\nPlease see the [minimatch\ndocumentation](https://github.com/isaacs/minimatch) for more details.\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n* [minimatch documentation](https://github.com/isaacs/minimatch)\n\n## glob(pattern, [options], cb)\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* `cb` {Function}\n  * `err` {Error | null}\n  * `matches` {Array<String>} filenames found matching the pattern\n\nPerform an asynchronous glob search.\n\n## glob.sync(pattern, [options]\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* return: {Array<String>} filenames found matching the pattern\n\nPerform a synchronous glob search.\n\n## Class: glob.Glob\n\nCreate a Glob object by instanting the `glob.Glob` class.\n\n```javascript\nvar Glob = require(\"glob\").Glob\nvar mg = new Glob(pattern, options, cb)\n```\n\nIt's an EventEmitter, and starts walking the filesystem to find matches\nimmediately.\n\n### new glob.Glob(pattern, [options], [cb])\n\n* `pattern` {String} pattern to search for\n* `options` {Object}\n* `cb` {Function} Called when an error occurs, or matches are found\n  * `err` {Error | null}\n  * `matches` {Array<String>} filenames found matching the pattern\n\nNote that if the `sync` flag is set in the options, then matches will\nbe immediately available on the `g.found` member.\n\n### Properties\n\n* `minimatch` The minimatch object that the glob uses.\n* `options` The options object passed in.\n* `error` The error encountered.  When an error is encountered, the\n  glob object is in an undefined state, and should be discarded.\n* `aborted` Boolean which is set to true when calling `abort()`.  There\n  is no way at this time to continue a glob search after aborting, but\n  you can re-use the statCache to avoid having to duplicate syscalls.\n\n### Events\n\n* `end` When the matching is finished, this is emitted with all the\n  matches found.  If the `nonull` option is set, and no match was found,\n  then the `matches` list contains the original pattern.  The matches\n  are sorted, unless the `nosort` flag is set.\n* `match` Every time a match is found, this is emitted with the matched.\n* `error` Emitted when an unexpected error is encountered, or whenever\n  any fs error occurs if `options.strict` is set.\n* `abort` When `abort()` is called, this event is raised.\n\n### Methods\n\n* `abort` Stop the search.\n\n### Options\n\nAll the options that can be passed to Minimatch can also be passed to\nGlob to change pattern matching behavior.  Also, some have been added,\nor have glob-specific ramifications.\n\nAll options are false by default, unless otherwise noted.\n\nAll options are added to the glob object, as well.\n\n* `cwd` The current working directory in which to search.  Defaults\n  to `process.cwd()`.\n* `root` The place where patterns starting with `/` will be mounted\n  onto.  Defaults to `path.resolve(options.cwd, \"/\")` (`/` on Unix\n  systems, and `C:\\` or some such on Windows.)\n* `nomount` By default, a pattern starting with a forward-slash will be\n  \"mounted\" onto the root setting, so that a valid filesystem path is\n  returned.  Set this flag to disable that behavior.\n* `mark` Add a `/` character to directory matches.  Note that this\n  requires additional stat calls.\n* `nosort` Don't sort the results.\n* `stat` Set to true to stat *all* results.  This reduces performance\n  somewhat, and is completely unnecessary, unless `readdir` is presumed\n  to be an untrustworthy indicator of file existence.  It will cause\n  ELOOP to be triggered one level sooner in the case of cyclical\n  symbolic links.\n* `silent` When an unusual error is encountered\n  when attempting to read a directory, a warning will be printed to\n  stderr.  Set the `silent` option to true to suppress these warnings.\n* `strict` When an unusual error is encountered\n  when attempting to read a directory, the process will just continue on\n  in search of other matches.  Set the `strict` option to raise an error\n  in these cases.\n* `statCache` A cache of results of filesystem information, to prevent\n  unnecessary stat calls.  While it should not normally be necessary to\n  set this, you may pass the statCache from one glob() call to the\n  options object of another, if you know that the filesystem will not\n  change between calls.  (See \"Race Conditions\" below.)\n* `sync` Perform a synchronous glob search.\n* `nounique` In some cases, brace-expanded patterns can result in the\n  same file showing up multiple times in the result set.  By default,\n  this implementation prevents duplicates in the result set.\n  Set this flag to disable that behavior.\n* `nonull` Set to never return an empty set, instead returning a set\n  containing the pattern itself.  This is the default in glob(3).\n* `nocase` Perform a case-insensitive match.  Note that case-insensitive\n  filesystems will sometimes result in glob returning results that are\n  case-insensitively matched anyway, since readdir and stat will not\n  raise an error.\n* `debug` Set to enable debug logging in minimatch and glob.\n* `globDebug` Set to enable debug logging in glob, but not minimatch.\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between node-glob and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated.  Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally.  This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`.  Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything.  Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set.  This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part.  That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.  **Note that this is different from the way that `**` is\nhandled by ruby's `Dir` class.**\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen glob returns the pattern as-provided, rather than\ninterpreting the character escapes.  For example,\n`glob.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`.  This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern.  Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity.  Since those two are valid, matching proceeds.\n\n## Windows\n\n**Please only use forward-slashes in glob expressions.**\n\nThough windows uses either `/` or `\\` as its path separator, only `/`\ncharacters are used by this glob implementation.  You must use\nforward-slashes **only** in glob expressions.  Back-slashes will always\nbe interpreted as escape characters, not path separators.\n\nResults from absolute patterns such as `/foo/*` are mounted onto the\nroot setting using `path.join`.  On windows, this will by default result\nin `/foo/*` matching `C:\\foo\\bar.txt`.\n\n## Race Conditions\n\nGlob searching, by its very nature, is susceptible to race conditions,\nsince it relies on directory walking and such.\n\nAs a result, it is possible that a file that exists when glob looks for\nit may have been deleted or modified by the time it returns the result.\n\nAs part of its internal implementation, this program caches all stat\nand readdir calls that it makes, in order to cut down on system\noverhead.  However, this also makes it even more susceptible to races,\nespecially if the statCache object is reused between glob calls.\n\nUsers are thus advised not to use a glob result as a\nguarantee of filesystem state in the face of rapid changes.\nFor the vast majority of operations, this is never a problem.\n",
   "readmeFilename": "README.md",
-  "_id": "glob@3.1.19",
-  "_from": "glob@~3.1.18"
+  "_id": "glob@3.1.20",
+  "dist": {
+    "shasum": "aeaba910c176cd1c90e200eefe4bb66f5b3763e7"
+  },
+  "_from": "glob@latest",
+  "_resolved": "https://registry.npmjs.org/glob/-/glob-3.1.20.tgz"
 }
index 22751c4..534c407 100644 (file)
@@ -118,6 +118,13 @@ Note that the user does not have to be the package owner to star or
 unstar a package, though other writes do require that the user be the
 package owner.
 
+# client.stars(username, cb)
+
+* `username` {String} Name of user to fetch starred packages for.
+* `cb` {Function}
+
+View your own or another user's starred packages.
+
 # client.tag(project, version, tag, cb)
 
 * `project` {String} Project name
index f506be4..42221fe 100644 (file)
@@ -8,7 +8,8 @@ var url = require("url")
   , request = require("request")
   , retry = require("retry")
 
-function regRequest (method, where, what, etag, nofollow, cb_) {
+function regRequest (method, where, what, etag, nofollow, reauthed, cb_) {
+  if (typeof cb_ !== "function") cb_ = reauthed, reauthed = false
   if (typeof cb_ !== "function") cb_ = nofollow, nofollow = false
   if (typeof cb_ !== "function") cb_ = etag, etag = null
   if (typeof cb_ !== "function") cb_ = what, what = null
@@ -84,7 +85,7 @@ function regRequest (method, where, what, etag, nofollow, cb_) {
         this.conf.set('_token', this.couchLogin.token)
         return regRequest.call(this,
                                method, where, what,
-                               etag, nofollow, cb_)
+                               etag, nofollow, reauthed, cb_)
       }.bind(this))
     }
   }
@@ -123,14 +124,22 @@ function regRequest (method, where, what, etag, nofollow, cb_) {
 
       // Only retry on 408, 5xx or no `response`.
       var statusCode = response && response.statusCode
-      var reauth = statusCode === 401
+
+      var reauth = !reauthed &&
+                   ( statusCode === 401 ||
+                     statusCode === 400 ||
+                     statusCode === 403 )
+      if (reauth)
+        reauthed = true
+
       var timeout = statusCode === 408
       var serverError = statusCode >= 500
       var statusRetry = !statusCode || timeout || serverError
       if (reauth && this.conf.get('_auth') && this.conf.get('_token')) {
         this.conf.del('_token')
         this.couchLogin.token = null
-        return regRequest.call(this, method, where, what, etag, nofollow, cb_)
+        return regRequest.call(this, method, where, what,
+                               etag, nofollow, reauthed, cb_)
       }
       if (er && statusRetry && operation.retry(er)) {
         self.log.info("retry", "will retry, error on last attempt: " + er)
diff --git a/deps/npm/node_modules/npm-registry-client/lib/stars.js b/deps/npm/node_modules/npm-registry-client/lib/stars.js
new file mode 100644 (file)
index 0000000..93f0d70
--- /dev/null
@@ -0,0 +1,9 @@
+var qs = require('querystring')
+
+module.exports = stars
+
+function stars (name, cb) {
+  name = encodeURIComponent(name)
+  var path = "/-/_view/starredByUser?key=\""+name+"\""
+  this.request("GET", path, cb)
+}
index 65ffd0c..3b7ab38 100644 (file)
@@ -24,9 +24,5 @@
   "readme": "# couch-login\n\nThis module lets you log into couchdb to get a session token, then make\nrequests using that session.  It is basically just a thin wrapper around\n[@mikeal's request module](https://github.com/mikeal/request).\n\nThis is handy if you want a user to take actions in a couchdb database\non behalf of a user, without having to store their couchdb username and\npassword anywhere.  (You do need to store the AuthSession token\nsomewhere, though.)\n\n## Usage\n\n```javascript\nvar CouchLogin = require('couch-login')\n\n// Nothing about this module is http-server specific of course.\n// You could also use it to do authenticated requests against\n// a couchdb using sessions and storing the token somewhere else.\n\nhttp.createServer(function (req, res) {\n  var couch = new CouchLogin('http://my-couch.iriscouch.com:5984/')\n\n  // .. look up the token in the user's session or whatever ..\n  // Look at couch.decorate(req, res) for more on doing that\n  // automatically, below.\n\n  if (sessionToken) {\n    // this user already logged in.\n    couch.token = sessionToken\n\n    // now we can do things on their behalf, like:\n    // 1. View their session info.\n    // like doing request.get({ uri: couch + '/_session', ... })\n    // but with the cookie and whatnot\n\n    couch.get('/_session', function (er, resp, data) {\n      // er = some kind of communication error.\n      // resp = response object from the couchdb request.\n      // data = parsed JSON response body.\n      if (er || resp.statusCode !== 200) {\n        res.statusCode = resp.statusCode || 403\n        return res.end('Invalid login or something')\n      }\n\n      // now we have the session info, we know who this user is.\n      // hitting couchdb for this on every request is kinda costly,\n      // so maybe you should store the username wherever you're storing\n      // the sessionToken.  RedSess is a good util for this, if you're\n      // into redis.  And if you're not into redis, you're crazy,\n      // because it is awesome.\n\n      // now let's get the user record.\n      // note that this will 404 for anyone other than the user,\n      // unless they're a server admin.\n      couch.get('/_users/org.couchdb.user:' + data.userCtx.name, etc)\n\n      // PUTs and DELETEs will also use their session, of course, so\n      // your validate_doc_update's will see their info in userCtx\n    })\n\n  } else {\n    // don't have a sessionToken.\n    // get a username and password from the post body or something.\n    // maybe redirect to a /login page or something to ask for that.\n    var login = { name: name, password: password }\n    couch.login(login, function (er, resp, data) {\n      // again, er is an error, resp is the response obj, data is the json\n      if (er || resp.statusCode !== 200) {\n        res.statusCode = resp.statusCode || 403\n        return res.end('Invalid login or something')\n      }\n\n      // the data is something like\n      // {\"ok\":true,\"name\":\"testuser\",\"roles\":[]}\n      // and couch.token is the token you'll need to save somewhere.\n\n      // at this point, you can start making authenticated requests to\n      // couchdb, or save data in their session, or do whatever it is\n      // that you need to do.\n\n      res.statusCode = 200\n      res.write(\"Who's got two thumbs and just logged you into couch?\\n\")\n      setTimeout(function () {\n        res.end(\"THIS GUY!\")\n      }, 500)\n    })\n  }\n})\n```\n\n## Class: CouchLogin\n### new CouchLogin(couchdbUrl, token)\n\nCreate a new CouchLogin object bound to the couchdb url.\n\nIn addition to these, the `get`, `post`, `put`, and `del` methods all\nproxy to the associated method on [request](https://github.com/mikeal/request).\n\nHowever, as you'll note in the example above, only the pathname portion\nof the url is required.  Urls will be appended to the couchdb url passed\ninto the constructor.\n\nIf you have to talk to more than one couchdb, then you'll need more than\none CouchLogin object, for somewhat obvious reasons.\n\nAll callbacks get called with the following arguments, which are exactly\nidentical to the arguments passed to a `request` callback.\n\n* `er` {Error | null} Set if a communication error happens.\n* `resp` {HTTP Response} The response from the request to couchdb\n* `data` {Object} The parsed JSON data from couch\n\nIf the token is the string \"anonymous\", then it will not attempt to log\nin before making requests.  If the token is not \"anonymous\", then it\nmust be an object with the appropriate fields.\n\n### couch.token\n\n* {Object}\n\nAn object representing the couchdb session token.  (Basically just a\ncookie and a timeout.)\n\nIf the token has already timed out, then setting it will have no effect.\n\n### couch.tokenSet\n\nIf set, this method is called whenever the token is saved.\n\nFor example, you could assign a function to this method to save the\ntoken into a redis session, a cookie, or in some other database.\n\nTakes a callback which should be called when the token is saved.\n\n### couch.tokenGet\n\nIf set, this method is called to look up the token on demand.\n\nThe inverse of couch.tokenSet.  Takes a callback which is called with\nthe `cb(er || null, token)`.\n\n### couch.tokenDel\n\nIf set, this method is called to delete the token when it should be\ndiscarded.\n\nRelated to tokenGet and tokenSet.  Takes a callback which should be\ncalled when the token is deleted.\n\n### couch.ca\n\n* {String | Array | null}\n\nA certificate authority string, or an array of CA strings.  Only\nrelevant for HTTPS couches, of course.\n\nLeave as `null` to use the default ca settings built into node.\n\n### couch.strictSSL\n\n* {Boolean | null}\n\nWhether or not to be strict about SSL connections.  If left as null,\nthen use the default setting in node, which is true in node versions\n0.9.x and above, and false prior to 0.8.x.\n\nOnly relevant for HTTPS couches, of course.\n\n### couch.anonymous()\n\nReturn a new CouchLogin object that points at the same couchdb server,\nbut doesn't try to log in before making requests.\n\nThis is handy for situations where the user is not logged in at the\nmoment, but a request needs to be made anyway, and does not require\nauthorization.\n\n### couch.login(auth, callback)\n\n* `auth` {Object} The login details\n  * `name` {String}\n  * `password` {String}\n* `callback` {Function}\n\nWhen the callback is called, the `couch.token` will already have been\nset (assuming it worked!), so subsequent requests will be done as that\nuser.\n\n### couch.get(path, callback)\n\nGET the supplied path from the couchdb using the credentials on the\ntoken.\n\nFails if the token is invalid or expired.\n\n### couch.del(path, callback)\n\nDELETE the supplied path from the couchdb using the credentials on the\ntoken.\n\nFails if the token is invalid or expired.\n\n### couch.post(path, data, callback)\n\nPOST the data to the supplied path in the couchdb, using the credentials\non the token.\n\nFails if the token is invalid or expired.\n\n### couch.put(path, data, callback)\n\nPUT the data to the supplied path in the couchdb, using the credentials\non the token.\n\nFails if the token is invalid or expired.\n\n### couch.changePass(newAuth, callback)\n\nMust already be logged in.  Updates the `_users` document with new salt\nand hash, and re-logs in with the new credentials.  Callback is called\nwith the same arguments as login, or the first step of the process that\nfailed.\n\n### couch.signup(userData, callback)\n\nCreate a new user account.  The userData must contain at least a `name`\nand `password` field.  Any additional data will be copied to the user\nrecord.  The `_id`, `name`, `roles`, `type`, `password_sha`, `salt`, and\n`date` fields are generated.\n\nAlso signs in as the newly created user, on successful account creation.\n\n### couch.deleteAccount(name, callback)\n\nDeletes a user account.  If not logged in as the user, or a server\nadmin, then the request will fail.\n\nNote that this immediately invalidates any session tokens for the\ndeleted user account.  If you are deleting the user's record, then you\nought to follow this with `couch.logout(callback)` so that it won't try\nto re-use the invalid session.\n\n### couch.logout(callback)\n\nDelete the session out of couchdb.  This makes the token permanently\ninvalid, and deletes it.\n\n### couch.decorate(req, res)\n\nSet up `req.couch` and `res.couch` as references to this couch login\ninstance.\n\nAdditionall, if `req.session` or `res.session` is set, then it'll call\n`session.get('couch_token', cb)` as the tokenGet method,\n`session.set('couch_token', token, cb)` as the tokenSet method, and\n`session.del('couch_token', cb)` as the tokenDel method.\n\nThis works really nice with\n[RedSess](https://github.com/isaacs/redsess).\n",
   "readmeFilename": "README.md",
   "_id": "couch-login@0.1.15",
-  "dist": {
-    "shasum": "5239feb4080aacfc736d539bf9ebafbd1c381f38"
-  },
-  "_from": "couch-login@~0.1.15",
-  "_resolved": "https://registry.npmjs.org/couch-login/-/couch-login-0.1.15.tgz"
+  "_from": "couch-login@~0.1.15"
 }
index 7af896e..5b23a9e 100644 (file)
@@ -6,7 +6,7 @@
   },
   "name": "npm-registry-client",
   "description": "Client for the npm registry",
-  "version": "0.2.13",
+  "version": "0.2.16",
   "repository": {
     "url": "git://github.com/isaacs/npm-registry-client"
   },
@@ -33,8 +33,8 @@
     "npmlog": ""
   },
   "license": "BSD",
-  "readme": "# npm-registry-client\n\nThe code that npm uses to talk to the registry.\n\nIt handles all the caching and HTTP calls.\n\n## Usage\n\n```javascript\nvar RegClient = require('npm-registry-client')\nvar client = new RegClient(config)\n\nclient.get(\"npm\", \"latest\", 1000, function (er, data, raw, res) {\n  // error is an error if there was a problem.\n  // data is the parsed data object\n  // raw is the json string\n  // res is the response from couch\n})\n```\n\n# Configuration\n\nThis program is designed to work with\n[npmconf](https://npmjs.org/package/npmconf), but you can also pass in\na plain-jane object with the appropriate configs, and it'll shim it\nfor you.  Any configuration thingie that has get/set/del methods will\nalso be accepted.\n\n* `registry` **Required** {String} URL to the registry\n* `cache` **Required** {String} Path to the cache folder\n* `always-auth` {Boolean} Auth even for GET requests.\n* `auth` {String} A base64-encoded `username:password`\n* `email` {String} User's email address\n* `tag` {String} The default tag to use when publishing new packages.\n  Default = `\"latest\"`\n* `ca` {String} Cerficate signing authority certificates to trust.\n* `strict-ssl` {Boolean} Whether or not to be strict with SSL\n  certificates.  Default = `true`\n* `user-agent` {String} User agent header to send.  Default =\n  `\"node/{process.version} {process.platform} {process.arch}\"`\n* `log` {Object} The logger to use.  Defaults to `require(\"npmlog\")` if\n  that works, otherwise logs are disabled.\n* `fetch-retries` {Number} Number of times to retry on GET failures.\n  Default=2\n* `fetch-retry-factor` {Number} `factor` setting for `node-retry`. Default=10\n* `fetch-retry-mintimeout` {Number} `minTimeout` setting for `node-retry`.\n  Default=10000 (10 seconds)\n* `fetch-retry-maxtimeout` {Number} `maxTimeout` setting for `node-retry`.\n  Default=60000 (60 seconds)\n* `proxy` {URL} The url to proxy requests through.\n* `https-proxy` {URL} The url to proxy https requests through.\n  Defaults to be the same as `proxy` if unset.\n* `_auth` {String} The base64-encoded authorization header.\n* `username` `_password` {String} Username/password to use to generate\n  `_auth` if not supplied.\n* `_token` {Object} A token for use with\n  [couch-login](https://npmjs.org/package/couch-login)\n\n# client.request(method, where, [what], [etag], [nofollow], cb)\n\n* `method` {String} HTTP method\n* `where` {String} Path to request on the server\n* `what` {Stream | Buffer | String | Object} The request body.  Objects\n  that are not Buffers or Streams are encoded as JSON.\n* `etag` {String} The cached ETag\n* `nofollow` {Boolean} Prevent following 302/301 responses\n* `cb` {Function}\n  * `error` {Error | null}\n  * `data` {Object} the parsed data object\n  * `raw` {String} the json\n  * `res` {Response Object} response from couch\n\nMake a request to the registry.  All the other methods are wrappers\naround this. one.\n\n# client.adduser(username, password, email, cb)\n\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `cb` {Function}\n\nAdd a user account to the registry, or verify the credentials.\n\n# client.get(url, [timeout], [nofollow], [staleOk], cb)\n\n* `url` {String} The url path to fetch\n* `timeout` {Number} Number of seconds old that a cached copy must be\n  before a new request will be made.\n* `nofollow` {Boolean} Do not follow 301/302 responses\n* `staleOk` {Boolean} If there's cached data available, then return that\n  to the callback quickly, and update the cache the background.\n\nFetches data from the registry via a GET request, saving it in\nthe cache folder with the ETag.\n\n# client.publish(data, tarball, [readme], cb)\n\n* `data` {Object} Package data\n* `tarball` {String | Stream} Filename or stream of the package tarball\n* `readme` {String} Contents of the README markdown file\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder.  However, it\ncan accept a gzipped tar stream or a filename to a tarball.\n\n# client.star(package, starred, cb)\n\n* `package` {String} Name of the package to star\n* `starred` {Boolean} True to star the package, false to unstar it.\n* `cb` {Function}\n\nStar or unstar a package.\n\nNote that the user does not have to be the package owner to star or\nunstar a package, though other writes do require that the user be the\npackage owner.\n\n# client.tag(project, version, tag, cb)\n\n* `project` {String} Project name\n* `version` {String} Version to tag\n* `tag` {String} Tag name to apply\n* `cb` {Function}\n\nMark a version in the `dist-tags` hash, so that `pkg@tag`\nwill fetch the specified version.\n\n# client.unpublish(name, [ver], cb)\n\n* `name` {String} package name\n* `ver` {String} version to unpublish. Leave blank to unpublish all\n  versions.\n* `cb` {Function}\n\nRemove a version of a package (or all versions) from the registry.  When\nthe last version us unpublished, the entire document is removed from the\ndatabase.\n\n# client.upload(where, file, [etag], [nofollow], cb)\n\n* `where` {String} URL path to upload to\n* `file` {String | Stream} Either the filename or a readable stream\n* `etag` {String} Cache ETag\n* `nofollow` {Boolean} Do not follow 301/302 responses\n* `cb` {Function}\n\nUpload an attachment.  Mostly used by `client.publish()`.\n",
+  "readme": "# npm-registry-client\n\nThe code that npm uses to talk to the registry.\n\nIt handles all the caching and HTTP calls.\n\n## Usage\n\n```javascript\nvar RegClient = require('npm-registry-client')\nvar client = new RegClient(config)\n\nclient.get(\"npm\", \"latest\", 1000, function (er, data, raw, res) {\n  // error is an error if there was a problem.\n  // data is the parsed data object\n  // raw is the json string\n  // res is the response from couch\n})\n```\n\n# Configuration\n\nThis program is designed to work with\n[npmconf](https://npmjs.org/package/npmconf), but you can also pass in\na plain-jane object with the appropriate configs, and it'll shim it\nfor you.  Any configuration thingie that has get/set/del methods will\nalso be accepted.\n\n* `registry` **Required** {String} URL to the registry\n* `cache` **Required** {String} Path to the cache folder\n* `always-auth` {Boolean} Auth even for GET requests.\n* `auth` {String} A base64-encoded `username:password`\n* `email` {String} User's email address\n* `tag` {String} The default tag to use when publishing new packages.\n  Default = `\"latest\"`\n* `ca` {String} Cerficate signing authority certificates to trust.\n* `strict-ssl` {Boolean} Whether or not to be strict with SSL\n  certificates.  Default = `true`\n* `user-agent` {String} User agent header to send.  Default =\n  `\"node/{process.version} {process.platform} {process.arch}\"`\n* `log` {Object} The logger to use.  Defaults to `require(\"npmlog\")` if\n  that works, otherwise logs are disabled.\n* `fetch-retries` {Number} Number of times to retry on GET failures.\n  Default=2\n* `fetch-retry-factor` {Number} `factor` setting for `node-retry`. Default=10\n* `fetch-retry-mintimeout` {Number} `minTimeout` setting for `node-retry`.\n  Default=10000 (10 seconds)\n* `fetch-retry-maxtimeout` {Number} `maxTimeout` setting for `node-retry`.\n  Default=60000 (60 seconds)\n* `proxy` {URL} The url to proxy requests through.\n* `https-proxy` {URL} The url to proxy https requests through.\n  Defaults to be the same as `proxy` if unset.\n* `_auth` {String} The base64-encoded authorization header.\n* `username` `_password` {String} Username/password to use to generate\n  `_auth` if not supplied.\n* `_token` {Object} A token for use with\n  [couch-login](https://npmjs.org/package/couch-login)\n\n# client.request(method, where, [what], [etag], [nofollow], cb)\n\n* `method` {String} HTTP method\n* `where` {String} Path to request on the server\n* `what` {Stream | Buffer | String | Object} The request body.  Objects\n  that are not Buffers or Streams are encoded as JSON.\n* `etag` {String} The cached ETag\n* `nofollow` {Boolean} Prevent following 302/301 responses\n* `cb` {Function}\n  * `error` {Error | null}\n  * `data` {Object} the parsed data object\n  * `raw` {String} the json\n  * `res` {Response Object} response from couch\n\nMake a request to the registry.  All the other methods are wrappers\naround this. one.\n\n# client.adduser(username, password, email, cb)\n\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `cb` {Function}\n\nAdd a user account to the registry, or verify the credentials.\n\n# client.get(url, [timeout], [nofollow], [staleOk], cb)\n\n* `url` {String} The url path to fetch\n* `timeout` {Number} Number of seconds old that a cached copy must be\n  before a new request will be made.\n* `nofollow` {Boolean} Do not follow 301/302 responses\n* `staleOk` {Boolean} If there's cached data available, then return that\n  to the callback quickly, and update the cache the background.\n\nFetches data from the registry via a GET request, saving it in\nthe cache folder with the ETag.\n\n# client.publish(data, tarball, [readme], cb)\n\n* `data` {Object} Package data\n* `tarball` {String | Stream} Filename or stream of the package tarball\n* `readme` {String} Contents of the README markdown file\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder.  However, it\ncan accept a gzipped tar stream or a filename to a tarball.\n\n# client.star(package, starred, cb)\n\n* `package` {String} Name of the package to star\n* `starred` {Boolean} True to star the package, false to unstar it.\n* `cb` {Function}\n\nStar or unstar a package.\n\nNote that the user does not have to be the package owner to star or\nunstar a package, though other writes do require that the user be the\npackage owner.\n\n# client.stars(username, cb)\n\n* `username` {String} Name of user to fetch starred packages for.\n* `cb` {Function}\n\nView your own or another user's starred packages.\n\n# client.tag(project, version, tag, cb)\n\n* `project` {String} Project name\n* `version` {String} Version to tag\n* `tag` {String} Tag name to apply\n* `cb` {Function}\n\nMark a version in the `dist-tags` hash, so that `pkg@tag`\nwill fetch the specified version.\n\n# client.unpublish(name, [ver], cb)\n\n* `name` {String} package name\n* `ver` {String} version to unpublish. Leave blank to unpublish all\n  versions.\n* `cb` {Function}\n\nRemove a version of a package (or all versions) from the registry.  When\nthe last version us unpublished, the entire document is removed from the\ndatabase.\n\n# client.upload(where, file, [etag], [nofollow], cb)\n\n* `where` {String} URL path to upload to\n* `file` {String | Stream} Either the filename or a readable stream\n* `etag` {String} Cache ETag\n* `nofollow` {Boolean} Do not follow 301/302 responses\n* `cb` {Function}\n\nUpload an attachment.  Mostly used by `client.publish()`.\n",
   "readmeFilename": "README.md",
-  "_id": "npm-registry-client@0.2.13",
+  "_id": "npm-registry-client@0.2.16",
   "_from": "npm-registry-client@latest"
 }
index 3c1370d..648f4ca 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "read-package-json",
-  "version": "0.1.13",
+  "version": "0.2.0",
   "author": {
     "name": "Isaac Z. Schlueter",
     "email": "i@izs.me",
@@ -32,6 +32,6 @@
   },
   "readme": "# read-package-json\n\nThis is the thing that npm uses to read package.json files.  It\nvalidates some stuff, and loads some default things.\n\nIt keeps a cache of the files you've read, so that you don't end\nup reading the same package.json file multiple times.\n\nNote that if you just want to see what's literally in the package.json\nfile, you can usually do `var data = require('some-module/package.json')`.\n\nThis module is basically only needed by npm, but it's handy to see what\nnpm will see when it looks at your package.\n\n## Usage\n\n```javascript\nvar readJson = require('read-package-json')\n\nreadJson('/path/to/package.json', function (er, data) {\n  if (er) {\n    console.error(\"There was an error reading the file\")\n    return\n  }\n\n  console.error('the package data is', data)\n}\n```\n\n## readJson(file, cb)\n\n* `file` {String} The path to the package.json file\n* `cb` {Function}\n\nReads the JSON file and does the things.\n\n## `package.json` Fields\n\nSee `man 5 package.json` or `npm help json`.\n\n## readJson.log\n\nBy default this is a reference to the `npmlog` module.  But if that\nmodule can't be found, then it'll be set to just a dummy thing that does\nnothing.\n\nReplace with your own `{log,warn,error}` object for fun loggy time.\n\n## readJson.extras(file, data, cb)\n\nRun all the extra stuff relative to the file, with the parsed data.\n\nModifies the data as it does stuff.  Calls the cb when it's done.\n\n## readJson.extraSet = [fn, fn, ...]\n\nArray of functions that are called by `extras`.  Each one receives the\narguments `fn(file, data, cb)` and is expected to call `cb(er, data)`\nwhen done or when an error occurs.\n\nOrder is indeterminate, so each function should be completely\nindependent.\n\nMix and match!\n\n## readJson.cache\n\nThe `lru-cache` object that readJson uses to not read the same file over\nand over again.  See\n[lru-cache](https://github.com/isaacs/node-lru-cache) for details.\n\n## Other Relevant Files Besides `package.json`\n\nSome other files have an effect on the resulting data object, in the\nfollowing ways:\n\n### `README?(.*)`\n\nIf there is a `README` or `README.*` file present, then npm will attach\na `readme` field to the data with the contents of this file.\n\nOwing to the fact that roughly 100% of existing node modules have\nMarkdown README files, it will generally be assumed to be Markdown,\nregardless of the extension.  Please plan accordingly.\n\n### `server.js`\n\nIf there is a `server.js` file, and there is not already a\n`scripts.start` field, then `scripts.start` will be set to `node\nserver.js`.\n\n### `AUTHORS`\n\nIf there is not already a `contributors` field, then the `contributors`\nfield will be set to the contents of the `AUTHORS` file, split by lines,\nand parsed.\n\n### `bindings.gyp`\n\nIf a bindings.gyp file exists, and there is not already a\n`scripts.install` field, then the `scripts.install` field will be set to\n`node-gyp rebuild`.\n\n### `wscript`\n\nIf a wscript file exists, and there is not already a `scripts.install`\nfield, then the `scripts.install` field will be set to `node-waf clean ;\nnode-waf configure build`.\n\nNote that the `bindings.gyp` file supercedes this, since node-waf has\nbeen deprecated in favor of node-gyp.\n\n### `index.js`\n\nIf the json file does not exist, but there is a `index.js` file\npresent instead, and that file has a package comment, then it will try\nto parse the package comment, and use that as the data instead.\n\nA package comment looks like this:\n\n```javascript\n/**package\n * { \"name\": \"my-bare-module\"\n * , \"version\": \"1.2.3\"\n * , \"description\": \"etc....\" }\n **/\n\n// or...\n\n/**package\n{ \"name\": \"my-bare-module\"\n, \"version\": \"1.2.3\"\n, \"description\": \"etc....\" }\n**/\n```\n\nThe important thing is that it starts with `/**package`, and ends with\n`**/`.  If the package.json file exists, then the index.js is not\nparsed.\n\n### `{directories.man}/*.[0-9]`\n\nIf there is not already a `man` field defined as an array of files or a\nsingle file, and\nthere is a `directories.man` field defined, then that directory will\nbe searched for manpages.\n\nAny valid manpages found in that directory will be assigned to the `man`\narray, and installed in the appropriate man directory at package install\ntime, when installed globally on a Unix system.\n\n### `{directories.bin}/*`\n\nIf there is not already a `bin` field defined as a string filename or a\nhash of `<name> : <filename>` pairs, then the `directories.bin`\ndirectory will be searched and all the files within it will be linked as\nexecutables at install time.\n\nWhen installing locally, npm links bins into `node_modules/.bin`, which\nis in the `PATH` environ when npm runs scripts.  When\ninstalling globally, they are linked into `{prefix}/bin`, which is\npresumably in the `PATH` environment variable.\n",
   "readmeFilename": "README.md",
-  "_id": "read-package-json@0.1.13",
+  "_id": "read-package-json@0.2.0",
   "_from": "read-package-json@latest"
 }
index 9f26cf0..6b8c29a 100644 (file)
@@ -554,14 +554,19 @@ function warn (f, d, m) {
 
 
 function validName (file, data) {
-                if (!data.name) return new Error("No 'name' field")
+                if (!data.name) {
+                                data.name = ""
+                                return true
+                }
                 data.name = data.name.trim()
                 if (data.name.charAt(0) === "." ||
                     data.name.match(/[\/@\s\+%:]/) ||
+                    data.name !== encodeURIComponent(data.name) ||
                     data.name.toLowerCase() === "node_modules" ||
                     data.name.toLowerCase() === "favicon.ico") {
-                                return new Error("Invalid name: " +
-                                                 JSON.stringify(data.name))
+                                var m = "Invalid name: "
+                                m += JSON.stringify(data.name)
+                                return new Error(m)
                 }
                 return true
 }
@@ -577,7 +582,10 @@ function parseKeywords (file, data) {
 
 function validVersion (file, data) {
                 var v = data.version
-                if (!v) return new Error("no version");
+                if (!v) {
+                                data.version = ""
+                                return true
+                }
                 if (!semver.valid(v)) {
                                 return new Error("invalid version: "+v)
                 }
index 406273a..517cac5 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "version": "1.2.10",
+  "version": "1.2.11",
   "name": "npm",
   "publishConfig": {
     "proprietary-attribs": false
@@ -59,7 +59,7 @@
     "npmlog": "0",
     "ansi": "~0.1.2",
     "npm-registry-client": "~0.2.13",
-    "read-package-json": "~0.1.8",
+    "read-package-json": "~0.2.0",
     "read-installed": "0",
     "glob": "~3.1.18",
     "init-package-json": "0.0.6",
index b0b8bd7..db5da04 100644 (file)
@@ -4,46 +4,43 @@
   "dependencies": {
     "npm-test-single-file": {
       "version": "1.2.3",
-      "from": "https://raw.github.com/gist/1837112/index.js",
       "resolved": "https://raw.github.com/gist/1837112/index.js"
     },
     "glob": {
       "version": "3.1.5",
-      "from": "glob@git://github.com/isaacs/node-glob.git#npm-test",
       "resolved": "git://github.com/isaacs/node-glob.git#67bda227fd7a559cca5620307c7d30a6732a792f",
       "dependencies": {
         "minimatch": {
           "version": "0.2.1",
           "dependencies": {
             "lru-cache": {
-              "version": "1.0.5",
-              "from": "lru-cache@~1.0.5"
+              "version": "1.0.5"
             }
           }
         },
         "graceful-fs": {
           "version": "1.1.5",
-          "from": "graceful-fs@1.1.5",
+          "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.5.tgz",
           "dependencies": {
             "fast-list": {
               "version": "1.0.2",
-              "from": "fast-list@1.0.2"
+              "resolved": "https://registry.npmjs.org/fast-list/-/fast-list-1.0.2.tgz"
             }
           }
         },
         "inherits": {
           "version": "1.0.0",
-          "from": "inherits@1.0.0"
+          "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz"
         }
       }
     },
     "minimatch": {
       "version": "0.1.5",
-      "from": "minimatch@0.1.5",
+      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.1.5.tgz",
       "dependencies": {
         "lru-cache": {
           "version": "1.0.5",
-          "from": "lru-cache@1.0.5"
+          "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-1.0.5.tgz"
         }
       }
     }