elisee <elisee@sparklin.org>
Evan You <yyx990803@gmail.com>
Wil Moore III <wil.moore@wilmoore.com>
+Dylan Greene <dylang@gmail.com>
+zeke <zeke@sikelianos.com>
+Andrew Horton <andrew.j.horton@gmail.com>
+Denis Gladkikh <outcoldman@gmail.com>
+Daniel Santiago <daniel.santiago@highlevelwebs.com>
+Alex Kocharin <alex@kocharin.ru>
+Evan Lucas <evanlucas@me.com>
+Steve Mason <stevem@brandwatch.com>
+Quinn Slack <qslack@qslack.com>
+Sébastien Santoro <dereckson@espace-win.org>
+CamilleM <camille.moulin@alterway.fr>
+Tom Huang <hzlhu.dargon@gmail.com>
+Sergey Belov <peimei@ya.ru>
+Younghoon Park <sola92@gmail.com>
+Yazhong Liu <yorkiefixer@gmail.com>
+Mikola Lysenko <mikolalysenko@gmail.com>
+Rafael de Oleza <rafa@spotify.com>
+Yeonghoon Park <sola92@gmail.com>
+Franck Cuny <franck.cuny@gmail.com>
+Alan Shaw <alan@freestyle-developments.co.uk>
+Alex Rodionov <p0deje@gmail.com>
+Alexej Yaroshevich <alex@qfox.ru>
+Elan Shanker <elan.shanker@gmail.com>
+François Frisch <francoisfrisch@gmail.com>
+Gabriel Falkenberg <gabriel.falkenberg@gmail.com>
+Jason Diamond <jason@diamond.name>
+Jess Martin <jessmartin@gmail.com>
+Jon Spencer <jon@jonspencer.ca>
+Matt Colyer <matt@colyer.name>
+Matt McClure <matt.mcclure@mapmyfitness.com>
+Maximilian Antoni <maximilian.antoni@juliusbaer.com>
+Nicholas Kinsey <pyro@feisty.io>
+Paulo Cesar <pauloc062@gmail.com>
+Quim Calpe <quim@kalpe.com>
+Robert Gieseke <robert.gieseke@gmail.com>
+Spain Train <michael.spainhower@opower.com>
+TJ Holowaychuk <tj@vision-media.ca>
+Thom Blake <tblake@brightroll.com>
+Trevor Burnham <tburnham@hubspot.com>
+bitspill <bitspill+github@bitspill.net>
+Neil Gentleman <ngentleman@gmail.com>
## Before you submit a new issue
-* Check if there's a simple solution in the [Troubleshooting](https://github.com/npm/npm/wiki/Troubleshooting) wiki.
-* [Search for similar issues](https://github.com/npm/npm/search?q=Similar%20issues&type=Issues).
-* Ensure your new issue conforms to the [Contributing Guidelines](https://github.com/npm/npm/wiki/Contributing-Guidelines).
+* Check if there's a simple solution in the
+ [Troubleshooting](https://github.com/npm/npm/wiki/Troubleshooting)
+ wiki.
+* [Search for similar
+ issues](https://github.com/npm/npm/search?q=Similar%20issues&type=Issues).
+* Ensure your new issue conforms to the [Contributing
+ Guidelines](https://github.com/npm/npm/wiki/Contributing-Guidelines).
## More Docs
-Check out the [docs](https://npmjs.org/doc/),
-especially the [faq](https://npmjs.org/doc/faq.html).
+Check out the [docs](https://www.npmjs.org/doc/),
+especially the [faq](https://www.npmjs.org/doc/faq.html).
You can use the `npm help` command to read any of them.
If you're a developer, and you want to use npm to publish your program,
-you should [read this](https://npmjs.org/doc/developers.html)
+you should [read this](https://www.npmjs.org/doc/developers.html)
## Legal Stuff
-"npm" and "the npm registry" are owned by Isaac Z. Schlueter.
+"npm" and "The npm Registry" are owned by npm, Inc.
All rights reserved. See the included LICENSE file for more details.
-"Node.js" and "node" are trademarks owned by Joyent, Inc. npm is not
-officially part of the Node.js project, and is neither owned by nor
-officially affiliated with Joyent, Inc.
+"Node.js" and "node" are trademarks owned by Joyent, Inc.
-The packages in the npm registry are not part of npm itself, and are the
-sole property of their respective maintainers. While every effort is
-made to ensure accountability, there is absolutely no guarantee,
-warrantee, or assertion made as to the quality, fitness for a specific
-purpose, or lack of malice in any given npm package. Modules
-published on the npm registry are not affiliated with or endorsed by
-Joyent, Inc., Isaac Z. Schlueter, Ryan Dahl, or the Node.js project.
+Modules published on the npm registry are not officially endorsed by
+npm, Inc. or the Node.js project.
-If you have a complaint about a package in the npm registry, and cannot
-resolve it with the package owner, please express your concerns to
-Isaac Z. Schlueter at <i@izs.me>.
+Data published to the npm registry is not part of npm itself, and is
+the sole property of the publisher. While every effort is made to
+ensure accountability, there is absolutely no guarantee, warrantee, or
+assertion expressed or implied as to the quality, fitness for a
+specific purpose, or lack of malice in any given npm package.
-### In plain english
+If you have a complaint about a package in the public npm registry,
+and cannot [resolve it with the package
+owner](https://www.npmjs.org/doc/misc/npm-disputes.html), please email
+<support@npmjs.com> and explain the situation.
-This is mine; not my employer's, not Node's, not Joyent's, not Ryan
-Dahl's.
+Any data published to The npm Registry (including user account
+information) may be removed or modified at the sole discretion of the
+npm server administrators.
+
+### In plainer english
+
+npm is the property of npm, Inc.
If you publish something, it's yours, and you are solely accountable
-for it. Not me, not Node, not Joyent, not Ryan Dahl.
+for it.
-If other people publish something, it's theirs. Not mine, not Node's,
-not Joyent's, not Ryan Dahl's.
+If other people publish something, it's theirs.
-Yes, you can publish something evil. It will be removed promptly if
-reported, and we'll lose respect for you. But there is no vetting
-process for published modules.
+Users can publish Bad Stuff. It will be removed promptly if reported.
+But there is no vetting process for published modules, and you use
+them at your own risk. Please inspect the source.
-If this concerns you, inspect the source before using packages.
+If you publish Bad Stuff, we may delete it from the registry, or even
+ban your account in extreme cases. So don't do that.
## BUGS
## SYNOPSIS
1. Get the author email with `npm owner ls <pkgname>`
-2. Email the author, CC <i@izs.me>.
+2. Email the author, CC <support@npmjs.com>
3. After a few weeks, if there's no resolution, we'll sort it out.
Don't squat on package names. Publish code or move out of the way.
1. `npm owner ls foo`. This will tell Joe the email address of the
owner (Bob).
-2. Joe emails Bob, explaining the situation **as respectfully as possible**,
- and what he would like to do with the module name. He adds
- isaacs <i@izs.me> to the CC list of the email. Mention in the email
- that Bob can run `npm owner add joe foo` to add Joe as an owner of
- the `foo` package.
+2. Joe emails Bob, explaining the situation **as respectfully as
+ possible**, and what he would like to do with the module name. He
+ adds the npm support staff <support@npmjs.com> to the CC list of
+ the email. Mention in the email that Bob can run `npm owner add
+ joe foo` to add Joe as an owner of the `foo` package.
3. After a reasonable amount of time, if Bob has not responded, or if
- Bob and Joe can't come to any sort of resolution, email isaacs
- <i@izs.me> and we'll sort it out. ("Reasonable" is usually about 4
- weeks, but extra time is allowed around common holidays.)
+ Bob and Joe can't come to any sort of resolution, email support
+ <support@npmjs.com> and we'll sort it out. ("Reasonable" is
+ usually at least 4 weeks, but extra time is allowed around common
+ holidays.)
## REASONING
## Where can I find these docs in HTML?
-<https://npmjs.org/doc/>, or run:
+<https://www.npmjs.org/doc/>, or run:
npm config set viewer browser
## Whatever, I really want the old style 'everything global' style.
-Write your own package manager, then. It's not that hard.
+Write your own package manager. You could probably even wrap up `npm`
+in a shell script if you really wanted to.
npm will not help you do something that is known to be a bad idea.
Either the registry is down, or node's DNS isn't able to reach out.
-To check if the registry is down, open up <http://registry.npmjs.org/>
-in a web browser. This will also tell you if you are just unable to
-access the internet for some reason.
+To check if the registry is down, open up
+<https://registry.npmjs.org/> in a web browser. This will also tell
+you if you are just unable to access the internet for some reason.
-If the registry IS down, let me know by emailing <i@izs.me> or posting
-an issue at <https://github.com/npm/npm/issues>. We'll have
-someone kick it or something.
+If the registry IS down, let us know by emailing <support@npmjs.com>
+or posting an issue at <https://github.com/npm/npm/issues>. If it's
+down for the world (and not just on your local network) then we're
+probably already being pinged about it.
+
+You can also often get a faster response by visiting the #npm channel
+on Freenode IRC.
## Why no namespaces?
## Who does npm?
-`npm view npm author`
+npm was originally written by Isaac Z. Schlueter, and many others have
+contributed to it, some of them quite substantially.
-`npm view npm contributors`
+The npm open source project, The npm Registry, and [the community
+website](https://www.npmjs.org) are maintained and operated by the
+good folks at [npm, Inc.](https://www.npmjs.com)
## I have a question or request not addressed here. Where should I put it?
<h2 id="More-Docs">More Docs</h2>
-<p>Check out the <a href="https://npmjs.org/doc/">docs</a>,
-especially the <a href="https://npmjs.org/doc/faq.html">faq</a>.</p>
+<p>Check out the <a href="https://www.npmjs.org/doc/">docs</a>,
+especially the <a href="https://www.npmjs.org/doc/faq.html">faq</a>.</p>
<p>You can use the <code>npm help</code> command to read any of them.</p>
<p>If you're a developer, and you want to use npm to publish your program,
-you should <a href="https://npmjs.org/doc/developers.html">read this</a></p>
+you should <a href="https://www.npmjs.org/doc/developers.html">read this</a></p>
<h2 id="Legal-Stuff">Legal Stuff</h2>
-<p>"npm" and "the npm registry" are owned by Isaac Z. Schlueter.
+<p>"npm" and "The npm Registry" are owned by npm, Inc.
All rights reserved. See the included LICENSE file for more details.</p>
-<p>"Node.js" and "node" are trademarks owned by Joyent, Inc. npm is not
-officially part of the Node.js project, and is neither owned by nor
-officially affiliated with Joyent, Inc.</p>
+<p>"Node.js" and "node" are trademarks owned by Joyent, Inc.</p>
-<p>The packages in the npm registry are not part of npm itself, and are the
-sole property of their respective maintainers. While every effort is
-made to ensure accountability, there is absolutely no guarantee,
-warrantee, or assertion made as to the quality, fitness for a specific
-purpose, or lack of malice in any given npm package. Modules
-published on the npm registry are not affiliated with or endorsed by
-Joyent, Inc., Isaac Z. Schlueter, Ryan Dahl, or the Node.js project.</p>
+<p>Modules published on the npm registry are not officially endorsed by
+npm, Inc. or the Node.js project.</p>
-<p>If you have a complaint about a package in the npm registry, and cannot
-resolve it with the package owner, please express your concerns to
-Isaac Z. Schlueter at <a href="mailto:i@izs.me">i@izs.me</a>.</p>
+<p>Data published to the npm registry is not part of npm itself, and is
+the sole property of the publisher. While every effort is made to
+ensure accountability, there is absolutely no guarantee, warrantee, or
+assertion expressed or implied as to the quality, fitness for a
+specific purpose, or lack of malice in any given npm package.</p>
-<h3 id="In-plain-english">In plain english</h3>
+<p>If you have a complaint about a package in the public npm registry,
+and cannot <a href="https://www.npmjs.org/doc/misc/npm-disputes.html">resolve it with the package
+owner</a>, please email
+<a href="mailto:support@npmjs.com">support@npmjs.com</a> and explain the situation.</p>
-<p>This is mine; not my employer's, not Node's, not Joyent's, not Ryan
-Dahl's.</p>
+<p>Any data published to The npm Registry (including user account
+information) may be removed or modified at the sole discretion of the
+npm server administrators.</p>
+
+<h3 id="In-plainer-english">In plainer english</h3>
+
+<p>npm is the property of npm, Inc.</p>
<p>If you publish something, it's yours, and you are solely accountable
-for it. Not me, not Node, not Joyent, not Ryan Dahl.</p>
+for it.</p>
-<p>If other people publish something, it's theirs. Not mine, not Node's,
-not Joyent's, not Ryan Dahl's.</p>
+<p>If other people publish something, it's theirs.</p>
-<p>Yes, you can publish something evil. It will be removed promptly if
-reported, and we'll lose respect for you. But there is no vetting
-process for published modules.</p>
+<p>Users can publish Bad Stuff. It will be removed promptly if reported.
+But there is no vetting process for published modules, and you use
+them at your own risk. Please inspect the source.</p>
-<p>If this concerns you, inspect the source before using packages.</p>
+<p>If you publish Bad Stuff, we may delete it from the registry, or even
+ban your account in extreme cases. So don't do that.</p>
<h2 id="BUGS">BUGS</h2>
<ul><li><a href="cli/npm.html">npm(1)</a></li><li><a href="misc/npm-faq.html">npm-faq(7)</a></li><li><a href="cli/npm-help.html">npm-help(1)</a></li><li><a href="misc/npm-index.html">npm-index(7)</a></li></ul>
</div>
-<p id="footer"><a href="../doc/README.html">README</a> — npm@1.4.0</p>
+<p id="footer"><a href="../doc/README.html">README</a> — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This function should not be used programmatically. Instead, just refer
to the <code>npm.bin</code> member.</p>
</div>
-<p id="footer">npm-bin — npm@1.4.0</p>
+<p id="footer">npm-bin — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This command will launch a browser, so this command may not be the most
friendly for programmatic use.</p>
</div>
-<p id="footer">npm-bugs — npm@1.4.0</p>
+<p id="footer">npm-bugs — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-index.html">npm-index(7)</a></li></ul>
</div>
-<p id="footer">npm-commands — npm@1.4.0</p>
+<p id="footer">npm-commands — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../api/npm.html">npm(3)</a></li></ul>
</div>
-<p id="footer">npm-config — npm@1.4.0</p>
+<p id="footer">npm-config — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../api/npm-publish.html">npm-publish(3)</a></li><li><a href="../api/npm-unpublish.html">npm-unpublish(3)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li></ul>
</div>
-<p id="footer">npm-deprecate — npm@1.4.0</p>
+<p id="footer">npm-deprecate — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This command will launch a browser, so this command may not be the most
friendly for programmatic use.</p>
</div>
-<p id="footer">npm-docs — npm@1.4.0</p>
+<p id="footer">npm-docs — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<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">npm-edit — npm@1.4.0</p>
+<p id="footer">npm-edit — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>The first element in the 'args' 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">npm-explore — npm@1.4.0</p>
+<p id="footer">npm-explore — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>The silent parameter is not neccessary not used, but it may in the future.</p>
</div>
-<p id="footer">npm-help-search — npm@1.4.0</p>
+<p id="footer">npm-help-search — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p><a href="../files/package.json.html">package.json(5)</a></p>
</div>
-<p id="footer">npm-init — npm@1.4.0</p>
+<p id="footer">npm-init — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Finally, 'callback' 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">npm-install — npm@1.4.0</p>
+<p id="footer">npm-install — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Now, any changes to the redis package will be reflected in
the package in the current working directory</p>
</div>
-<p id="footer">npm-link — npm@1.4.0</p>
+<p id="footer">npm-link — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>For a list of all the available command-line configs, see <code>npm help config</code></p>
</div>
-<p id="footer">npm-load — npm@1.4.0</p>
+<p id="footer">npm-load — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
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">npm-ls — npm@1.4.0</p>
+<p id="footer">npm-ls — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>If the 'packages' parameter is left out, npm will check all packages.</p>
</div>
-<p id="footer">npm-outdated — npm@1.4.0</p>
+<p id="footer">npm-outdated — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../api/npm-publish.html">npm-publish(3)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li></ul>
</div>
-<p id="footer">npm-owner — npm@1.4.0</p>
+<p id="footer">npm-owner — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>If no arguments are supplied, then npm packs the current package folder.</p>
</div>
-<p id="footer">npm-pack — npm@1.4.0</p>
+<p id="footer">npm-pack — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This function is not useful programmatically</p>
</div>
-<p id="footer">npm-prefix — npm@1.4.0</p>
+<p id="footer">npm-prefix — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Extraneous packages are packages that are not listed on the parent
package's dependencies list.</p>
</div>
-<p id="footer">npm-prune — npm@1.4.0</p>
+<p id="footer">npm-prune — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li><li><a href="../api/npm-owner.html">npm-owner(3)</a></li></ul>
</div>
-<p id="footer">npm-publish — npm@1.4.0</p>
+<p id="footer">npm-publish — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>See <code>npm help build</code></p>
</div>
-<p id="footer">npm-rebuild — npm@1.4.0</p>
+<p id="footer">npm-rebuild — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This command will launch a browser, so this command may not be the most
friendly for programmatic use.</p>
</div>
-<p id="footer">npm-repo — npm@1.4.0</p>
+<p id="footer">npm-repo — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../api/npm-start.html">npm-start(3)</a></li><li><a href="../api/npm-stop.html">npm-stop(3)</a></li></ul>
</div>
-<p id="footer">npm-restart — npm@1.4.0</p>
+<p id="footer">npm-restart — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This function is not useful programmatically.</p>
</div>
-<p id="footer">npm-root — npm@1.4.0</p>
+<p id="footer">npm-root — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../api/npm-test.html">npm-test(3)</a></li><li><a href="../api/npm-start.html">npm-start(3)</a></li><li><a href="../api/npm-restart.html">npm-restart(3)</a></li><li><a href="../api/npm-stop.html">npm-stop(3)</a></li></ul>
</div>
-<p id="footer">npm-run-script — npm@1.4.0</p>
+<p id="footer">npm-run-script — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
and doesn't try to read your mind (it doesn't do any verb tense matching or the
like).</p>
</div>
-<p id="footer">npm-search — npm@1.4.0</p>
+<p id="footer">npm-search — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Finally, 'callback' is a function that will be called when the shrinkwrap has
been saved.</p>
</div>
-<p id="footer">npm-shrinkwrap — npm@1.4.0</p>
+<p id="footer">npm-shrinkwrap — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>npm can run tests on multiple packages. Just specify multiple packages
in the <code>packages</code> parameter.</p>
</div>
-<p id="footer">npm-start — npm@1.4.0</p>
+<p id="footer">npm-start — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>npm can run stop on multiple packages. Just specify multiple packages
in the <code>packages</code> parameter.</p>
</div>
-<p id="footer">npm-stop — npm@1.4.0</p>
+<p id="footer">npm-stop — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li>npm help json</li><li>git help submodule</li></ul>
</div>
-<p id="footer">npm-submodule — npm@1.4.0</p>
+<p id="footer">npm-submodule — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
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">npm-tag — npm@1.4.0</p>
+<p id="footer">npm-tag — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>npm can run tests on multiple packages. Just specify multiple packages
in the <code>packages</code> parameter.</p>
</div>
-<p id="footer">npm-test — npm@1.4.0</p>
+<p id="footer">npm-test — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Finally, 'callback' 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">npm-uninstall — npm@1.4.0</p>
+<p id="footer">npm-uninstall — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<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">npm-unpublish — npm@1.4.0</p>
+<p id="footer">npm-unpublish — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>The 'packages' argument is an array of packages to update. The 'callback' parameter will be called when done or when an error occurs.</p>
</div>
-<p id="footer">npm-update — npm@1.4.0</p>
+<p id="footer">npm-update — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
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">npm-version — npm@1.4.0</p>
+<p id="footer">npm-version — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>corresponding to the list of fields selected.</p>
</div>
-<p id="footer">npm-view — npm@1.4.0</p>
+<p id="footer">npm-view — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This function is not useful programmatically</p>
</div>
-<p id="footer">npm-whoami — npm@1.4.0</p>
+<p id="footer">npm-whoami — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="VERSION">VERSION</h2>
-<p>1.4.0</p>
+<p>1.4.3</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<pre><code>var cmd = npm.deref("unp") // cmd === "unpublish"</code></pre>
</div>
-<p id="footer">npm — npm@1.4.0</p>
+<p id="footer">npm — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../cli/npm-owner.html">npm-owner(1)</a></li><li><a href="../cli/npm-whoami.html">npm-whoami(1)</a></li></ul>
</div>
-<p id="footer">npm-adduser — npm@1.4.0</p>
+<p id="footer">npm-adduser — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-prefix.html">npm-prefix(1)</a></li><li><a href="../cli/npm-root.html">npm-root(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-bin — npm@1.4.0</p>
+<p id="footer">npm-bin — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-docs.html">npm-docs(1)</a></li><li><a href="../cli/npm-view.html">npm-view(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li></ul>
</div>
-<p id="footer">npm-bugs — npm@1.4.0</p>
+<p id="footer">npm-bugs — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-link.html">npm-link(1)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li></ul>
</div>
-<p id="footer">npm-build — npm@1.4.0</p>
+<p id="footer">npm-build — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
</div>
-<p id="footer">npm-bundle — npm@1.4.0</p>
+<p id="footer">npm-bundle — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../cli/npm-pack.html">npm-pack(1)</a></li></ul>
</div>
-<p id="footer">npm-cache — npm@1.4.0</p>
+<p id="footer">npm-cache — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">npm-completion — npm@1.4.0</p>
+<p id="footer">npm-completion — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">npm-config — npm@1.4.0</p>
+<p id="footer">npm-config — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-ls.html">npm-ls(1)</a></li><li><a href="../cli/npm-update.html">npm-update(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
</div>
-<p id="footer">npm-dedupe — npm@1.4.0</p>
+<p id="footer">npm-dedupe — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li></ul>
</div>
-<p id="footer">npm-deprecate — npm@1.4.0</p>
+<p id="footer">npm-deprecate — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-view.html">npm-view(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li></ul>
</div>
-<p id="footer">npm-docs — npm@1.4.0</p>
+<p id="footer">npm-docs — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-explore.html">npm-explore(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-edit — npm@1.4.0</p>
+<p id="footer">npm-edit — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-submodule.html">npm-submodule(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-edit.html">npm-edit(1)</a></li><li><a href="../cli/npm-rebuild.html">npm-rebuild(1)</a></li><li><a href="../cli/npm-build.html">npm-build(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
</div>
-<p id="footer">npm-explore — npm@1.4.0</p>
+<p id="footer">npm-explore — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm.html">npm(1)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm-help.html">npm-help(1)</a></li></ul>
</div>
-<p id="footer">npm-help-search — npm@1.4.0</p>
+<p id="footer">npm-help-search — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm.html">npm(1)</a></li><li><a href="../../doc/README.html">README</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-help-search.html">npm-help-search(1)</a></li><li><a href="../misc/npm-index.html">npm-index(7)</a></li></ul>
</div>
-<p id="footer">npm-help — npm@1.4.0</p>
+<p id="footer">npm-help — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="https://github.com/isaacs/init-package-json">https://github.com/isaacs/init-package-json</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-version.html">npm-version(1)</a></li></ul>
</div>
-<p id="footer">npm-init — npm@1.4.0</p>
+<p id="footer">npm-init — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-update.html">npm-update(1)</a></li><li><a href="../cli/npm-link.html">npm-link(1)</a></li><li><a href="../cli/npm-rebuild.html">npm-rebuild(1)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-build.html">npm-build(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-tag.html">npm-tag(1)</a></li><li><a href="../cli/npm-rm.html">npm-rm(1)</a></li><li><a href="../cli/npm-shrinkwrap.html">npm-shrinkwrap(1)</a></li></ul>
</div>
-<p id="footer">npm-install — npm@1.4.0</p>
+<p id="footer">npm-install — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-link — npm@1.4.0</p>
+<p id="footer">npm-link — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
nested packages will <em>also</em> show the paths to the specified packages.
For example, running <code>npm ls promzard</code> in npm's source tree will show:</p>
-<pre><code>npm@1.4.0 /path/to/npm
+<pre><code>npm@1.4.3 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5</code></pre>
<ul><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-link.html">npm-link(1)</a></li><li><a href="../cli/npm-prune.html">npm-prune(1)</a></li><li><a href="../cli/npm-outdated.html">npm-outdated(1)</a></li><li><a href="../cli/npm-update.html">npm-update(1)</a></li></ul>
</div>
-<p id="footer">npm-ls — npm@1.4.0</p>
+<p id="footer">npm-ls — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-update.html">npm-update(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li></ul>
</div>
-<p id="footer">npm-outdated — npm@1.4.0</p>
+<p id="footer">npm-outdated — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li><li><a href="../misc/npm-disputes.html">npm-disputes(7)</a></li></ul>
</div>
-<p id="footer">npm-owner — npm@1.4.0</p>
+<p id="footer">npm-owner — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-cache.html">npm-cache(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-pack — npm@1.4.0</p>
+<p id="footer">npm-pack — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-root.html">npm-root(1)</a></li><li><a href="../cli/npm-bin.html">npm-bin(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-prefix — npm@1.4.0</p>
+<p id="footer">npm-prefix — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-rm.html">npm-rm(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-ls.html">npm-ls(1)</a></li></ul>
</div>
-<p id="footer">npm-prune — npm@1.4.0</p>
+<p id="footer">npm-prune — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li><li><a href="../cli/npm-owner.html">npm-owner(1)</a></li><li><a href="../cli/npm-deprecate.html">npm-deprecate(1)</a></li><li><a href="../cli/npm-tag.html">npm-tag(1)</a></li></ul>
</div>
-<p id="footer">npm-publish — npm@1.4.0</p>
+<p id="footer">npm-publish — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-build.html">npm-build(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
</div>
-<p id="footer">npm-rebuild — npm@1.4.0</p>
+<p id="footer">npm-rebuild — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-docs.html">npm-docs(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li></ul>
</div>
-<p id="footer">npm-repo — npm@1.4.0</p>
+<p id="footer">npm-repo — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-run-script.html">npm-run-script(1)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-test.html">npm-test(1)</a></li><li><a href="../cli/npm-start.html">npm-start(1)</a></li><li><a href="../cli/npm-stop.html">npm-stop(1)</a></li></ul>
</div>
-<p id="footer">npm-restart — npm@1.4.0</p>
+<p id="footer">npm-restart — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-prune.html">npm-prune(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-rm — npm@1.4.0</p>
+<p id="footer">npm-rm — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-prefix.html">npm-prefix(1)</a></li><li><a href="../cli/npm-bin.html">npm-bin(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-root — npm@1.4.0</p>
+<p id="footer">npm-root — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-test.html">npm-test(1)</a></li><li><a href="../cli/npm-start.html">npm-start(1)</a></li><li><a href="../cli/npm-restart.html">npm-restart(1)</a></li><li><a href="../cli/npm-stop.html">npm-stop(1)</a></li></ul>
</div>
-<p id="footer">npm-run-script — npm@1.4.0</p>
+<p id="footer">npm-run-script — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../cli/npm-view.html">npm-view(1)</a></li></ul>
</div>
-<p id="footer">npm-search — npm@1.4.0</p>
+<p id="footer">npm-search — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-ls.html">npm-ls(1)</a></li></ul>
</div>
-<p id="footer">npm-shrinkwrap — npm@1.4.0</p>
+<p id="footer">npm-shrinkwrap — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-view.html">npm-view(1)</a></li><li><a href="../cli/npm-whoami.html">npm-whoami(1)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li></ul>
</div>
-<p id="footer">npm-star — npm@1.4.0</p>
+<p id="footer">npm-star — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-star.html">npm-star(1)</a></li><li><a href="../cli/npm-view.html">npm-view(1)</a></li><li><a href="../cli/npm-whoami.html">npm-whoami(1)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li></ul>
</div>
-<p id="footer">npm-stars — npm@1.4.0</p>
+<p id="footer">npm-stars — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-run-script.html">npm-run-script(1)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-test.html">npm-test(1)</a></li><li><a href="../cli/npm-restart.html">npm-restart(1)</a></li><li><a href="../cli/npm-stop.html">npm-stop(1)</a></li></ul>
</div>
-<p id="footer">npm-start — npm@1.4.0</p>
+<p id="footer">npm-start — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-run-script.html">npm-run-script(1)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-test.html">npm-test(1)</a></li><li><a href="../cli/npm-start.html">npm-start(1)</a></li><li><a href="../cli/npm-restart.html">npm-restart(1)</a></li></ul>
</div>
-<p id="footer">npm-stop — npm@1.4.0</p>
+<p id="footer">npm-stop — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../files/package.json.html">package.json(5)</a></li><li>git help submodule</li></ul>
</div>
-<p id="footer">npm-submodule — npm@1.4.0</p>
+<p id="footer">npm-submodule — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-dedupe.html">npm-dedupe(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-tag — npm@1.4.0</p>
+<p id="footer">npm-tag — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-run-script.html">npm-run-script(1)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-start.html">npm-start(1)</a></li><li><a href="../cli/npm-restart.html">npm-restart(1)</a></li><li><a href="../cli/npm-stop.html">npm-stop(1)</a></li></ul>
</div>
-<p id="footer">npm-test — npm@1.4.0</p>
+<p id="footer">npm-test — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-prune.html">npm-prune(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-uninstall — npm@1.4.0</p>
+<p id="footer">npm-uninstall — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-deprecate.html">npm-deprecate(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li><li><a href="../cli/npm-owner.html">npm-owner(1)</a></li></ul>
</div>
-<p id="footer">npm-unpublish — npm@1.4.0</p>
+<p id="footer">npm-unpublish — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-outdated.html">npm-outdated(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-ls.html">npm-ls(1)</a></li></ul>
</div>
-<p id="footer">npm-update — npm@1.4.0</p>
+<p id="footer">npm-update — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-init.html">npm-init(1)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../misc/semver.html">semver(7)</a></li></ul>
</div>
-<p id="footer">npm-version — npm@1.4.0</p>
+<p id="footer">npm-version — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-search.html">npm-search(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../cli/npm-docs.html">npm-docs(1)</a></li></ul>
</div>
-<p id="footer">npm-view — npm@1.4.0</p>
+<p id="footer">npm-view — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li></ul>
</div>
-<p id="footer">npm-whoami — npm@1.4.0</p>
+<p id="footer">npm-whoami — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="VERSION">VERSION</h2>
-<p>1.4.0</p>
+<p>1.4.3</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<ul><li><a href="../cli/npm-help.html">npm-help(1)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../../doc/README.html">README</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-index.html">npm-index(7)</a></li><li><a href="../api/npm.html">npm(3)</a></li></ul>
</div>
-<p id="footer">npm — npm@1.4.0</p>
+<p id="footer">npm — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-pack.html">npm-pack(1)</a></li><li><a href="../cli/npm-cache.html">npm-cache(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li></ul>
</div>
-<p id="footer">npm-folders — npm@1.4.0</p>
+<p id="footer">npm-folders — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-pack.html">npm-pack(1)</a></li><li><a href="../cli/npm-cache.html">npm-cache(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li></ul>
</div>
-<p id="footer">npm-folders — npm@1.4.0</p>
+<p id="footer">npm-folders — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/semver.html">semver(7)</a></li><li><a href="../cli/npm-init.html">npm-init(1)</a></li><li><a href="../cli/npm-version.html">npm-version(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../cli/npm-help.html">npm-help(1)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../cli/npm-rm.html">npm-rm(1)</a></li></ul>
</div>
-<p id="footer">package.json — npm@1.4.0</p>
+<p id="footer">package.json — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">npmrc — npm@1.4.0</p>
+<p id="footer">npmrc — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/semver.html">semver(7)</a></li><li><a href="../cli/npm-init.html">npm-init(1)</a></li><li><a href="../cli/npm-version.html">npm-version(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../cli/npm-help.html">npm-help(1)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../cli/npm-rm.html">npm-rm(1)</a></li></ul>
</div>
-<p id="footer">package.json — npm@1.4.0</p>
+<p id="footer">package.json — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>The semantic versioner for npm</p>
</div>
-<p id="footer">npm-index — npm@1.4.0</p>
+<p id="footer">npm-index — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">npm-coding-style — npm@1.4.0</p>
+<p id="footer">npm-coding-style — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">npm-config — npm@1.4.0</p>
+<p id="footer">npm-config — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm.html">npm(1)</a></li><li><a href="../cli/npm-init.html">npm-init(1)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li></ul>
</div>
-<p id="footer">npm-developers — npm@1.4.0</p>
+<p id="footer">npm-developers — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="SYNOPSIS">SYNOPSIS</h2>
-<ol><li>Get the author email with <code>npm owner ls <pkgname></code></li><li>Email the author, CC <a href="mailto:i@izs.me">i@izs.me</a>.</li><li>After a few weeks, if there's no resolution, we'll sort it out.</li></ol>
+<ol><li>Get the author email with <code>npm owner ls <pkgname></code></li><li>Email the author, CC <a href="mailto:support@npmjs.com">support@npmjs.com</a></li><li>After a few weeks, if there's no resolution, we'll sort it out.</li></ol>
<p>Don't squat on package names. Publish code or move out of the way.</p>
Joe's appropriate course of action in each case is the same.</p>
<ol><li><code>npm owner ls foo</code>. This will tell Joe the email address of the
-owner (Bob).</li><li>Joe emails Bob, explaining the situation <strong>as respectfully as possible</strong>,
-and what he would like to do with the module name. He adds
-isaacs <a href="mailto:i@izs.me">i@izs.me</a> to the CC list of the email. Mention in the email
-that Bob can run <code>npm owner add joe foo</code> to add Joe as an owner of
-the <code>foo</code> package.</li><li>After a reasonable amount of time, if Bob has not responded, or if
-Bob and Joe can't come to any sort of resolution, email isaacs
-<a href="mailto:i@izs.me">i@izs.me</a> and we'll sort it out. ("Reasonable" is usually about 4
-weeks, but extra time is allowed around common holidays.)</li></ol>
+owner (Bob).</li><li>Joe emails Bob, explaining the situation <strong>as respectfully as
+possible</strong>, and what he would like to do with the module name. He
+adds the npm support staff <a href="mailto:support@npmjs.com">support@npmjs.com</a> to the CC list of
+the email. Mention in the email that Bob can run <code>npm owner add
+joe foo</code> to add Joe as an owner of the <code>foo</code> package.</li><li>After a reasonable amount of time, if Bob has not responded, or if
+Bob and Joe can't come to any sort of resolution, email support
+<a href="mailto:support@npmjs.com">support@npmjs.com</a> and we'll sort it out. ("Reasonable" is
+usually at least 4 weeks, but extra time is allowed around common
+holidays.)</li></ol>
<h2 id="REASONING">REASONING</h2>
<ul><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-owner.html">npm-owner(1)</a></li></ul>
</div>
-<p id="footer">npm-disputes — npm@1.4.0</p>
+<p id="footer">npm-disputes — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="Where-can-I-find-these-docs-in-HTML">Where can I find these docs in HTML?</h2>
-<p><a href="https://npmjs.org/doc/">https://npmjs.org/doc/</a>, or run:</p>
+<p><a href="https://www.npmjs.org/doc/">https://www.npmjs.org/doc/</a>, or run:</p>
<pre><code>npm config set viewer browser</code></pre>
<h2 id="Whatever-I-really-want-the-old-style-everything-global-style">Whatever, I really want the old style 'everything global' style.</h2>
-<p>Write your own package manager, then. It's not that hard.</p>
+<p>Write your own package manager. You could probably even wrap up <code>npm</code>
+in a shell script if you really wanted to.</p>
<p>npm will not help you do something that is known to be a bad idea.</p>
<p>Either the registry is down, or node's DNS isn't able to reach out.</p>
-<p>To check if the registry is down, open up <a href="http://registry.npmjs.org/">http://registry.npmjs.org/</a>
-in a web browser. This will also tell you if you are just unable to
-access the internet for some reason.</p>
+<p>To check if the registry is down, open up
+<a href="https://registry.npmjs.org/">https://registry.npmjs.org/</a> in a web browser. This will also tell
+you if you are just unable to access the internet for some reason.</p>
-<p>If the registry IS down, let me know by emailing <a href="mailto:i@izs.me">i@izs.me</a> or posting
-an issue at <a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a>. We'll have
-someone kick it or something.</p>
+<p>If the registry IS down, let us know by emailing <a href="mailto:support@npmjs.com">support@npmjs.com</a>
+or posting an issue at <a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a>. If it's
+down for the world (and not just on your local network) then we're
+probably already being pinged about it.</p>
+
+<p>You can also often get a faster response by visiting the #npm channel
+on Freenode IRC.</p>
<h2 id="Why-no-namespaces">Why no namespaces?</h2>
<h2 id="Who-does-npm">Who does npm?</h2>
-<p><code>npm view npm author</code></p>
+<p>npm was originally written by Isaac Z. Schlueter, and many others have
+contributed to it, some of them quite substantially.</p>
-<p><code>npm view npm contributors</code></p>
+<p>The npm open source project, The npm Registry, and <a href="https://www.npmjs.org">the community
+website</a> are maintained and operated by the
+good folks at <a href="https://www.npmjs.com">npm, Inc.</a></p>
<h2 id="I-have-a-question-or-request-not-addressed-here-Where-should-I-put-it">I have a question or request not addressed here. Where should I put it?</h2>
<ul><li><a href="../cli/npm.html">npm(1)</a></li><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li></ul>
</div>
-<p id="footer">npm-faq — npm@1.4.0</p>
+<p id="footer">npm-faq — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>The semantic versioner for npm</p>
</div>
-<p id="footer">npm-index — npm@1.4.0</p>
+<p id="footer">npm-index — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../misc/npm-disputes.html">npm-disputes(7)</a></li></ul>
</div>
-<p id="footer">npm-registry — npm@1.4.0</p>
+<p id="footer">npm-registry — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-run-script.html">npm-run-script(1)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
</div>
-<p id="footer">npm-scripts — npm@1.4.0</p>
+<p id="footer">npm-scripts — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../../doc/README.html">README</a></li><li><a href="../cli/npm-rm.html">npm-rm(1)</a></li><li><a href="../cli/npm-prune.html">npm-prune(1)</a></li></ul>
</div>
-<p id="footer">removing-npm — npm@1.4.0</p>
+<p id="footer">removing-npm — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
range.</li><li>maxSatisfying(versions, range): Return the highest version in the list
that satisfies the range, or null if none of them do.</li></ul>
</div>
-<p id="footer">semver — npm@1.4.0</p>
+<p id="footer">semver — npm@1.4.3</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
, fetch = require("./utils/fetch.js")
, npm = require("./npm.js")
, fs = require("graceful-fs")
- , rm = require("rimraf")
+ , rm = require("./utils/gently-rm.js")
, readJson = require("read-package-json")
, registry = npm.registry
, log = require("npmlog")
var p = url.parse(spec) || {}
log.verbose("parsed url", p)
- // it could be that we got name@http://blah
+ // If there's a /, and it's a path, then install the path.
+ // If not, and there's a @, it could be that we got name@http://blah
// in that case, we will not have a protocol now, but if we
// split and check, we will.
- if (!name && !p.protocol && spec.indexOf("@") !== -1) {
- spec = spec.split("@")
- name = spec.shift()
- spec = spec.join("@")
- return add([name, spec], cb)
+ if (!name && !p.protocol) {
+ if (spec.indexOf("/") !== -1 ||
+ process.platform === "win32" && spec.indexOf("\\") !== -1) {
+ return maybeFile(spec, p, cb)
+ } else if (spec.indexOf("@") !== -1) {
+ return maybeAt(spec, cb)
+ }
}
+ add_(name, spec, p, cb)
+}
+
+function maybeFile (spec, p, cb) {
+ fs.stat(spec, function (er, stat) {
+ if (!er) {
+ // definitely a local thing
+ addLocal(spec, cb)
+ } else if (er && spec.indexOf("@") !== -1) {
+ // bar@baz/loofa
+ maybeAt(spec, cb)
+ } else {
+ // Already know it's not a url, so must be local
+ addLocal(spec, cb)
+ }
+ })
+}
+
+function maybeAt (spec, cb) {
+ var tmp = spec.split("@")
+
+ // split name@2.3.4 only if name is a valid package name,
+ // don't split in case of "./test@example.com/" (local path)
+ var name = tmp.shift()
+ spec = tmp.join("@")
+ return add([name, spec], cb)
+}
+
+function add_ (name, spec, p, cb) {
switch (p.protocol) {
case "http:":
case "https:":
iF.push(cb_)
if (iF.length > 1) return
+ // git is so tricky!
+ // if the path is like ssh://foo:22/some/path then it works, but
+ // it needs the ssh://
+ // If the path is like ssh://foo:some/path then it works, but
+ // only if you remove the ssh://
+ var origUrl = u
+ u = u.replace(/^git\+/, "")
+ .replace(/#.*$/, "")
+
+ // ssh paths that are scp-style urls don't need the ssh://
+ if (parsed.pathname.match(/^\/?:/)) {
+ u = u.replace(/^ssh:\/\//, "")
+ }
+
function cb (er, data) {
unlock(u, function () {
var c
while (c = iF.shift()) c(er, data)
- delete inFlightURLs[u]
+ delete inFlightURLs[origUrl]
})
}
- var p, co // cachePath, git-ref we want to check out
-
lock(u, function (er) {
if (er) return cb(er)
// figure out what we should check out.
var co = parsed.hash && parsed.hash.substr(1) || "master"
- // git is so tricky!
- // if the path is like ssh://foo:22/some/path then it works, but
- // it needs the ssh://
- // If the path is like ssh://foo:some/path then it works, but
- // only if you remove the ssh://
- var origUrl = u
- u = u.replace(/^git\+/, "")
- .replace(/#.*$/, "")
-
- // ssh paths that are scp-style urls don't need the ssh://
- if (parsed.pathname.match(/^\/?:/)) {
- u = u.replace(/^ssh:\/\//, "")
- }
var v = crypto.createHash("sha1").update(u).digest("hex").slice(0, 8)
v = u.replace(/[^a-zA-Z0-9]+/g, '-') + '-' + v
log.verbose("addRemoteGit", [u, co])
- p = path.join(npm.config.get("cache"), "_git-remotes", v)
+ var p = path.join(npm.config.get("cache"), "_git-remotes", v)
checkGitDir(p, u, co, origUrl, silent, function(er, data) {
chmodr(p, npm.modes.file, function(erChmod) {
function unlock (u, cb) {
var lf = lockFileName(u)
- if (!myLocks[lf]) return process.nextTick(cb)
- myLocks[lf] = false
- lockFile.unlock(lockFileName(u), cb)
+ , locked = myLocks[lf]
+ if (locked === false) {
+ return process.nextTick(cb)
+ } else if (locked === true) {
+ myLocks[lf] = false
+ lockFile.unlock(lockFileName(u), cb)
+ } else {
+ throw new Error("Attempt to unlock " + u + ", which hasn't been locked")
+ }
}
function needName(er, data) {
var RegClient = require("npm-registry-client")
var npmconf = require("npmconf")
var semver = require("semver")
-var rimraf = require("rimraf")
+var rm = require("./utils/gently-rm.js")
var log = require("npmlog")
var npm = require("./npm.js")
}, function (er, installed) {
if (er) return cb(er)
- asyncMap(remove, rimraf, function (er) {
+ asyncMap(remove, rm, function (er) {
if (er) return cb(er)
remove.forEach(function (r) {
log.info("rm", r)
var regVersions = er ? [] : Object.keys(data.versions)
var locMatch = bestMatch(versions, ranges)
var regMatch;
- var tag = npm.config.get("tag");
- var distTags = data["dist-tags"];
- if (distTags && distTags[tag] && data.versions[distTags[tag]]) {
- regMatch = distTags[tag]
+ var tag = npm.config.get("tag")
+ var distTag = data["dist-tags"] && data["dist-tags"][tag]
+ if (distTag && data.versions[distTag] && matches(distTag, ranges)) {
+ regMatch = distTag
} else {
regMatch = bestMatch(regVersions, ranges)
}
}, cb)
}
+function matches (version, ranges) {
+ return !ranges.some(function (r) {
+ return !semver.satisfies(version, r, true)
+ })
+}
+
function bestMatch (versions, ranges) {
return versions.filter(function (v) {
- return !ranges.some(function (r) {
- return !semver.satisfies(v, r, true)
- })
+ return matches(v, ranges)
}).sort(semver.compareLoose).pop()
}
}
function findPeerInvalid (where, cb) {
- readInstalled(where, log.warn, function (er, data) {
+ readInstalled(where, { log: log.warn }, function (er, data) {
if (er) return cb(er)
cb(null, findPeerInvalid_(data.dependencies, []))
}).reduce(function (set, k) {
var rangeDescriptor = semver.valid(k[1], true) &&
semver.gte(k[1], "0.1.0", true)
- ? "~" : ""
+ ? "^" : ""
set[k[0]] = rangeDescriptor + k[1]
return set
}, {})
, asyncMap = require("slide").asyncMap
, chain = require("slide").chain
, path = require("path")
- , rm = require("rimraf")
+ , rm = require("./utils/gently-rm.js")
, build = require("./build.js")
module.exports = link
return cb_(er, [[d && d._id, target, null, null]])
}
if (er) return cb(er)
+ if (!d.name) {
+ er = new Error("Package must have a name field to be linked")
+ return cb(er)
+ }
var target = path.resolve(npm.globalDir, d.name)
rm(target, function (er) {
if (er) return cb(er)
})
var depth = npm.config.get("depth")
- readInstalled(dir, depth, log.warn, function (er, data) {
+ var opt = { depth: depth, log: log.warn }
+ readInstalled(dir, opt, function (er, data) {
var bfs = bfsify(data, args)
, lite = getLite(bfs)
, chain = slide.chain
, RegClient = require("npm-registry-client")
-npm.config = {loaded: false}
+npm.config = {
+ loaded: false,
+ get: function() {
+ throw new Error('npm.load() required')
+ },
+ set: function() {
+ throw new Error('npm.load() required')
+ }
+}
// /usr/local is often a read-only fs, which is not
// well handled by node or mkdirp. Just double-check
If no packages are specified, then run for all installed
packages.
+--parseable creates output like this:
+<fullpath>:<name@wanted>:<name@installed>:<name@latest>
+
*/
module.exports = outdated
, color = require("ansicolors")
, styles = require("ansistyles")
, table = require("text-table")
+ , semver = require("semver")
+ , os = require("os")
function outdated (args, silent, cb) {
if (typeof cb !== "function") cb = silent, silent = false
if (er || silent) return cb(er, list)
if (npm.config.get("json")) {
console.log(makeJSON(list))
+ } else if (npm.config.get("parseable")) {
+ console.log(makeParseable(list));
} else {
var outList = list.map(makePretty)
- var outTable = [[ styles.underline("Package")
- , styles.underline("Current")
- , styles.underline("Wanted")
- , styles.underline("Latest")
- , styles.underline("Location")
+ var outTable = [[ "Package"
+ , "Current"
+ , "Wanted"
+ , "Latest"
+ , "Location"
]].concat(outList)
+
+ if (npm.color) {
+ outTable[0] = outTable[0].map(function(heading) {
+ return styles.underline(heading)
+ })
+ }
+
var tableOpts = { align: ["l", "r", "r", "r", "l"]
, stringLength: function(s) { return ansiTrim(s).length }
}
})
}
-// [[ dir, dep, has, want ]]
+// [[ dir, dep, has, want, latest ]]
function makePretty (p) {
var parseable = npm.config.get("parseable")
- , long = npm.config.get("long")
, dep = p[1]
, dir = path.resolve(p[0], "node_modules", dep)
, has = p[2]
, want = p[3]
, latest = p[4]
- // XXX add --json support
- // Should match (more or less) the output of ls --json
-
- if (parseable) {
- var str = dir
- if (npm.config.get("long")) {
- str += ":" + dep + "@" + want
- + ":" + (has ? (dep + "@" + has) : "MISSING")
- }
- return str
- }
-
if (!npm.config.get("global")) {
dir = path.relative(process.cwd(), dir)
}
- return [ has === want ? color.yellow(dep) : color.red(dep)
- , (has || "MISSING")
- , color.green(want)
- , color.magenta(latest)
- , color.brightBlack(dirToPrettyLocation(dir))
- ]
+
+ var columns = [ dep
+ , has || "MISSING"
+ , want
+ , latest
+ , dirToPrettyLocation(dir)
+ ]
+
+ if (npm.color) {
+ columns[0] = color[has === want ? "yellow" : "red"](columns[0]) // dep
+ columns[2] = color.green(columns[2]) // want
+ columns[3] = color.magenta(columns[3]) // latest
+ columns[4] = color.brightBlack(columns[4]) // dir
+ }
+
+ return columns
}
function ansiTrim (str) {
.replace(/[[/\\]node_modules[/\\]/g, " > ")
}
+function makeParseable (list) {
+ return list.map(function (p) {
+ var dep = p[1]
+ , dir = path.resolve(p[0], "node_modules", dep)
+ , has = p[2]
+ , want = p[3]
+ , latest = p[4];
+
+ return [ dir
+ , dep + "@" + want
+ , (has ? (dep + "@" + has) : "MISSING")
+ , dep + "@" + latest
+ ].join(":")
+ }).join(os.EOL)
+}
+
function makeJSON (list) {
var out = {}
list.forEach(function (p) {
var registry = npm.registry
// search for the latest package
- registry.get(dep + "/latest", function (er, l) {
+ registry.get(dep, function (er, d) {
if (er) return cb()
- // so, we can conceivably update this. find out if we need to.
- cache.add(dep, req, function (er, d) {
+ if (!d || !d['dist-tags'] || !d.versions) return cb()
+ var l = d.versions[d['dist-tags'].latest]
+ if (!l) return cb()
+
+ // set to true if found in doc
+ var found = false
+
+ var r = req
+ if (d['dist-tags'][req])
+ r = d['dist-tags'][req]
+
+ if (semver.validRange(r, true)) {
+ // some kind of semver range.
+ // see if it's in the doc.
+ var vers = Object.keys(d.versions)
+ var v = semver.maxSatisfying(vers, r, true)
+ if (v) {
+ return onCacheAdd(null, d.versions[v])
+ }
+ }
+
+ // We didn't find the version in the doc. See if cache can find it.
+ cache.add(dep, req, onCacheAdd)
+
+ function onCacheAdd(er, d) {
// if this fails, then it means we can't update this thing.
// it's probably a thing that isn't published.
if (er) {
doIt(d.version, l.version)
else
skip()
- })
+ }
+
})
}
})
function next() {
- readInstalled(npm.prefix, npm.config.get("depth"), function (er, data) {
+ var opt = { depth: npm.config.get("depth"), dev: npm.config.get("production") }
+ readInstalled(npm.prefix, opt, function (er, data) {
if (er) return cb(er)
prune_(args, data, cb)
})
rebuild.completion = require("./utils/completion/installed-deep.js")
function rebuild (args, cb) {
- readInstalled(npm.prefix, npm.config.get("depth"), function (er, data) {
+ var opt = { depth: npm.config.get("depth") }
+ readInstalled(npm.prefix, opt, function (er, data) {
log.info("readInstalled", typeof data)
if (er) return cb(er)
var set = filter(data, args)
return cb(er)
if (data.devDependencies) {
Object.keys(data.devDependencies).forEach(function (dep) {
+ if (data.dependencies && data.dependencies[dep]) {
+ // do not exclude the dev dependency if it's also listed as a dependency
+ return
+ }
+
log.warn("shrinkwrap", "Excluding devDependency: %s", dep)
delete pkginfo.dependencies[dep]
})
function save (pkginfo, silent, cb) {
+ // copy the keys over in a well defined order
+ // because javascript objects serialize arbitrarily
+ pkginfo.dependencies = copyOrder(pkginfo.dependencies)
try {
var swdata = JSON.stringify(pkginfo, null, 2) + "\n"
} catch (er) {
cb(null, pkginfo)
})
}
+
+function copyOrder(obj) {
+ var result = {}
+ var keys = Object.keys(obj).sort()
+ keys.forEach(function (key) {
+ result[key] = obj[key]
+ })
+ return result
+}
unbuild.usage = "npm unbuild <folder>\n(this is plumbing)"
var readJson = require("read-package-json")
- , rm = require("rimraf")
+ , rm = require("./utils/gently-rm.js")
, gentlyRm = require("./utils/gently-rm.js")
, npm = require("./npm.js")
, path = require("path")
function installedDeep (opts, cb) {
var local
, global
+ , depth = npm.config.get("depth")
+ , opt = { depth: depth }
+
if (npm.config.get("global")) local = [], next()
- else readInstalled(npm.prefix, npm.config.get("depth"), function (er, data) {
+ else readInstalled(npm.prefix, opt, function (er, data) {
local = getNames(data || {})
next()
})
- readInstalled(npm.config.get("prefix"), npm.config.get("depth"), function (er, data) {
+
+ readInstalled(npm.config.get("prefix"), opt, function (er, data) {
global = getNames(data || {})
next()
})
, path = require("path")
function gentlyRm (p, gently, cb) {
+ if (!cb) cb = gently, gently = null
+
+ // never rm the root, prefix, or bin dirs.
+ // just a safety precaution.
+ p = path.resolve(p)
+ if (p === npm.dir ||
+ p === npm.root ||
+ p === npm.bin ||
+ p === npm.prefix ||
+ p === npm.globalDir ||
+ p === npm.globalRoot ||
+ p === npm.globalBin ||
+ p === npm.globalPrefix) {
+ return cb(new Error("May not delete: " + p))
+ }
+
if (npm.config.get("force") || !gently) {
return rimraf(p, cb)
}
, path = require("path")
, log = require("npmlog")
, uidNumber = require("uid-number")
- , rm = require("rimraf")
+ , rm = require("./gently-rm.js")
, readJson = require("read-package-json")
, cache = require("../cache.js")
, myUid = process.getuid && process.getuid()
if (name === ".") return cb(view.usage)
// get the data about this package
- registry.get(name, 600, function (er, data) {
+ registry.get(name, function (er, data) {
if (er) return cb(er)
if (data["dist-tags"].hasOwnProperty(version)) {
version = data["dist-tags"][version]
help config\fR to learn about all the options you can set there\.
.
.SH "More Docs"
-Check out the docs \fIhttps://npmjs\.org/doc/\fR,
-especially the faq \fIhttps://npmjs\.org/doc/faq\.html\fR\|\.
+Check out the docs \fIhttps://www\.npmjs\.org/doc/\fR,
+especially the faq \fIhttps://www\.npmjs\.org/doc/faq\.html\fR\|\.
.
.P
You can use the \fBnpm help\fR command to read any of them\.
.
.P
If you\'re a developer, and you want to use npm to publish your program,
-you should read this \fIhttps://npmjs\.org/doc/developers\.html\fR
+you should read this \fIhttps://www\.npmjs\.org/doc/developers\.html\fR
.
.SH "Legal Stuff"
-"npm" and "the npm registry" are owned by Isaac Z\. Schlueter\.
+"npm" and "The npm Registry" are owned by npm, Inc\.
All rights reserved\. See the included LICENSE file for more details\.
.
.P
-"Node\.js" and "node" are trademarks owned by Joyent, Inc\. npm is not
-officially part of the Node\.js project, and is neither owned by nor
-officially affiliated with Joyent, Inc\.
+"Node\.js" and "node" are trademarks owned by Joyent, Inc\.
.
.P
-The packages in the npm registry are not part of npm itself, and are the
-sole property of their respective maintainers\. While every effort is
-made to ensure accountability, there is absolutely no guarantee,
-warrantee, or assertion made as to the quality, fitness for a specific
-purpose, or lack of malice in any given npm package\. Modules
-published on the npm registry are not affiliated with or endorsed by
-Joyent, Inc\., Isaac Z\. Schlueter, Ryan Dahl, or the Node\.js project\.
+Modules published on the npm registry are not officially endorsed by
+npm, Inc\. or the Node\.js project\.
.
.P
-If you have a complaint about a package in the npm registry, and cannot
-resolve it with the package owner, please express your concerns to
-Isaac Z\. Schlueter at \fIi@izs\.me\fR\|\.
+Data published to the npm registry is not part of npm itself, and is
+the sole property of the publisher\. While every effort is made to
+ensure accountability, there is absolutely no guarantee, warrantee, or
+assertion expressed or implied as to the quality, fitness for a
+specific purpose, or lack of malice in any given npm package\.
.
-.SS "In plain english"
-This is mine; not my employer\'s, not Node\'s, not Joyent\'s, not Ryan
-Dahl\'s\.
+.P
+If you have a complaint about a package in the public npm registry,
+and cannot resolve it with the package
+owner \fIhttps://www\.npmjs\.org/doc/misc/npm\-disputes\.html\fR, please email \fIsupport@npmjs\.com\fR and explain the situation\.
+.
+.P
+Any data published to The npm Registry (including user account
+information) may be removed or modified at the sole discretion of the
+npm server administrators\.
+.
+.SS "In plainer english"
+npm is the property of npm, Inc\.
.
.P
If you publish something, it\'s yours, and you are solely accountable
-for it\. Not me, not Node, not Joyent, not Ryan Dahl\.
+for it\.
.
.P
-If other people publish something, it\'s theirs\. Not mine, not Node\'s,
-not Joyent\'s, not Ryan Dahl\'s\.
+If other people publish something, it\'s theirs\.
.
.P
-Yes, you can publish something evil\. It will be removed promptly if
-reported, and we\'ll lose respect for you\. But there is no vetting
-process for published modules\.
+Users can publish Bad Stuff\. It will be removed promptly if reported\.
+But there is no vetting process for published modules, and you use
+them at your own risk\. Please inspect the source\.
.
.P
-If this concerns you, inspect the source before using packages\.
+If you publish Bad Stuff, we may delete it from the registry, or even
+ban your account in extreme cases\. So don\'t do that\.
.
.SH "BUGS"
When you find issues, please report them:
.IP "" 4
.
.nf
-npm@1.4.0 /path/to/npm
+npm@1.4.3 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.
.fi
.
.SH "VERSION"
-1.4.0
+1.4.3
.
.SH "DESCRIPTION"
npm is the package manager for the Node JavaScript platform\. It puts
.fi
.
.SH "VERSION"
-1.4.0
+1.4.3
.
.SH "DESCRIPTION"
This is the API documentation for npm\.
Get the author email with \fBnpm owner ls <pkgname>\fR
.
.IP "2" 4
-Email the author, CC \fIi@izs\.me\fR\|\.
+Email the author, CC \fIsupport@npmjs\.com\fR
.
.IP "3" 4
After a few weeks, if there\'s no resolution, we\'ll sort it out\.
owner (Bob)\.
.
.IP "2" 4
-Joe emails Bob, explaining the situation \fBas respectfully as possible\fR,
-and what he would like to do with the module name\. He adds
-isaacs \fIi@izs\.me\fR to the CC list of the email\. Mention in the email
-that Bob can run \fBnpm owner add joe foo\fR to add Joe as an owner of
-the \fBfoo\fR package\.
+Joe emails Bob, explaining the situation \fBas respectfully as
+possible\fR, and what he would like to do with the module name\. He
+adds the npm support staff \fIsupport@npmjs\.com\fR to the CC list of
+the email\. Mention in the email that Bob can run \fBnpm owner add
+joe foo\fR to add Joe as an owner of the \fBfoo\fR package\.
.
.IP "3" 4
After a reasonable amount of time, if Bob has not responded, or if
-Bob and Joe can\'t come to any sort of resolution, email isaacs \fIi@izs\.me\fR and we\'ll sort it out\. ("Reasonable" is usually about 4
-weeks, but extra time is allowed around common holidays\.)
+Bob and Joe can\'t come to any sort of resolution, email support \fIsupport@npmjs\.com\fR and we\'ll sort it out\. ("Reasonable" is
+usually at least 4 weeks, but extra time is allowed around common
+holidays\.)
.
.IP "" 0
.
\fBnpm-faq\fR \-\- Frequently Asked Questions
.
.SH "Where can I find these docs in HTML?"
-\fIhttps://npmjs\.org/doc/\fR, or run:
+\fIhttps://www\.npmjs\.org/doc/\fR, or run:
.
.IP "" 4
.
program that uses it\.
.
.SH "Whatever, I really want the old style 'everything global' style\."
-Write your own package manager, then\. It\'s not that hard\.
+Write your own package manager\. You could probably even wrap up \fBnpm\fR
+in a shell script if you really wanted to\.
.
.P
npm will not help you do something that is known to be a bad idea\.
Either the registry is down, or node\'s DNS isn\'t able to reach out\.
.
.P
-To check if the registry is down, open up \fIhttp://registry\.npmjs\.org/\fR
-in a web browser\. This will also tell you if you are just unable to
-access the internet for some reason\.
+To check if the registry is down, open up \fIhttps://registry\.npmjs\.org/\fR in a web browser\. This will also tell
+you if you are just unable to access the internet for some reason\.
.
.P
-If the registry IS down, let me know by emailing \fIi@izs\.me\fR or posting
-an issue at \fIhttps://github\.com/npm/npm/issues\fR\|\. We\'ll have
-someone kick it or something\.
+If the registry IS down, let us know by emailing \fIsupport@npmjs\.com\fR
+or posting an issue at \fIhttps://github\.com/npm/npm/issues\fR\|\. If it\'s
+down for the world (and not just on your local network) then we\'re
+probably already being pinged about it\.
+.
+.P
+You can also often get a faster response by visiting the #npm channel
+on Freenode IRC\.
.
.SH "Why no namespaces?"
Please see this discussion: \fIhttps://github\.com/npm/npm/issues/798\fR
There is not sufficient need to impose namespace rules on everyone\.
.
.SH "Who does npm?"
-\fBnpm view npm author\fR
+npm was originally written by Isaac Z\. Schlueter, and many others have
+contributed to it, some of them quite substantially\.
.
.P
-\fBnpm view npm contributors\fR
+The npm open source project, The npm Registry, and the community
+website \fIhttps://www\.npmjs\.org\fR are maintained and operated by the
+good folks at npm, Inc\. \fIhttps://www\.npmjs\.com\fR
.
.SH "I have a question or request not addressed here\. Where should I put it?"
Post an issue on the github project:
},
"homepage": "https://github.com/isaacs/node-glob",
"_id": "glob@3.2.7",
- "_from": "glob@~3.2.6"
+ "_from": "glob@3.2.7"
}
}
ReaddirReq.prototype.done = function(er, files) {
+ if (files && files.sort)
+ files = files.sort()
Req.prototype.done.call(this, er, files)
onclose()
}
},
"name": "graceful-fs",
"description": "A drop-in replacement for fs, making various improvements.",
- "version": "2.0.1",
+ "version": "2.0.2",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-graceful-fs.git"
"EACCESS"
],
"license": "BSD",
- "readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over fs module\n\ngraceful-fs:\n\n* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/node-graceful-fs/issues"
},
- "_id": "graceful-fs@2.0.1",
- "_from": "graceful-fs@~2.0.0"
+ "readme": "ERROR: No README data found!",
+ "homepage": "https://github.com/isaacs/node-graceful-fs",
+ "_id": "graceful-fs@2.0.2",
+ "_from": "graceful-fs@latest"
}
--- /dev/null
+var test = require("tap").test
+var fs = require("fs")
+
+var readdir = fs.readdir
+fs.readdir = function(path, cb) {
+ process.nextTick(function() {
+ cb(null, ["b", "z", "a"])
+ })
+}
+
+var g = require("../")
+
+test("readdir reorder", function (t) {
+ g.readdir("whatevers", function (er, files) {
+ if (er)
+ throw er
+ console.error(files)
+ t.same(files, [ "a", "b", "z" ])
+ t.end()
+ })
+})
$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.
{ foo: "Mr. Foo", argv: { remain: ["-fp"] } }
-$ node my-program.js --blatzk 1000 -fp # unknown opts are ok.
-{ blatzk: 1000, flag: true, pick: true }
-
-$ node my-program.js --blatzk true -fp # but they need a value
+$ node my-program.js --blatzk -fp # unknown opts are ok.
{ blatzk: true, flag: true, pick: true }
+$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value
+{ blatzk: 1000, flag: true, pick: true }
+
$ node my-program.js --no-blatzk -fp # unless they start with "no-"
{ blatzk: false, flag: true, pick: true }
}
function validatePath (data, k, val) {
+ if (val === true) return false
data[k] = path.resolve(String(val))
return true
}
continue
}
+ if (types[arg] === String && la === undefined)
+ la = ""
+
if (la && la.match(/^-{2,}$/)) {
la = undefined
i --
return shorthands[arg]
}
-
-if (module === require.main) {
-var assert = require("assert")
- , util = require("util")
-
- , shorthands =
- { s : ["--loglevel", "silent"]
- , d : ["--loglevel", "info"]
- , dd : ["--loglevel", "verbose"]
- , ddd : ["--loglevel", "silly"]
- , noreg : ["--no-registry"]
- , reg : ["--registry"]
- , "no-reg" : ["--no-registry"]
- , silent : ["--loglevel", "silent"]
- , verbose : ["--loglevel", "verbose"]
- , h : ["--usage"]
- , H : ["--usage"]
- , "?" : ["--usage"]
- , help : ["--usage"]
- , v : ["--version"]
- , f : ["--force"]
- , desc : ["--description"]
- , "no-desc" : ["--no-description"]
- , "local" : ["--no-global"]
- , l : ["--long"]
- , p : ["--parseable"]
- , porcelain : ["--parseable"]
- , g : ["--global"]
- }
-
- , types =
- { aoa: Array
- , nullstream: [null, Stream]
- , date: Date
- , str: String
- , browser : String
- , cache : path
- , color : ["always", Boolean]
- , depth : Number
- , description : Boolean
- , dev : Boolean
- , editor : path
- , force : Boolean
- , global : Boolean
- , globalconfig : path
- , group : [String, Number]
- , gzipbin : String
- , logfd : [Number, Stream]
- , loglevel : ["silent","win","error","warn","info","verbose","silly"]
- , long : Boolean
- , "node-version" : [false, String]
- , npaturl : url
- , npat : Boolean
- , "onload-script" : [false, String]
- , outfd : [Number, Stream]
- , parseable : Boolean
- , pre: Boolean
- , prefix: path
- , proxy : url
- , "rebuild-bundle" : Boolean
- , registry : url
- , searchopts : String
- , searchexclude: [null, String]
- , shell : path
- , t: [Array, String]
- , tag : String
- , tar : String
- , tmp : path
- , "unsafe-perm" : Boolean
- , usage : Boolean
- , user : String
- , username : String
- , userconfig : path
- , version : Boolean
- , viewer: path
- , _exit : Boolean
- }
-
-; [["-v", {version:true}, []]
- ,["---v", {version:true}, []]
- ,["ls -s --no-reg connect -d",
- {loglevel:"info",registry:null},["ls","connect"]]
- ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]]
- ,["ls --registry blargle", {}, ["ls"]]
- ,["--no-registry", {registry:null}, []]
- ,["--no-color true", {color:false}, []]
- ,["--no-color false", {color:true}, []]
- ,["--no-color", {color:false}, []]
- ,["--color false", {color:false}, []]
- ,["--color --logfd 7", {logfd:7,color:true}, []]
- ,["--color=true", {color:true}, []]
- ,["--logfd=10", {logfd:10}, []]
- ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]]
- ,["--tmp=tmp -tar=gtar",
- {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]]
- ,["--logfd x", {}, []]
- ,["a -true -- -no-false", {true:true},["a","-no-false"]]
- ,["a -no-false", {false:false},["a"]]
- ,["a -no-no-true", {true:true}, ["a"]]
- ,["a -no-no-no-false", {false:false}, ["a"]]
- ,["---NO-no-No-no-no-no-nO-no-no"+
- "-No-no-no-no-no-no-no-no-no"+
- "-no-no-no-no-NO-NO-no-no-no-no-no-no"+
- "-no-body-can-do-the-boogaloo-like-I-do"
- ,{"body-can-do-the-boogaloo-like-I-do":false}, []]
- ,["we are -no-strangers-to-love "+
- "--you-know=the-rules --and=so-do-i "+
- "---im-thinking-of=a-full-commitment "+
- "--no-you-would-get-this-from-any-other-guy "+
- "--no-gonna-give-you-up "+
- "-no-gonna-let-you-down=true "+
- "--no-no-gonna-run-around false "+
- "--desert-you=false "+
- "--make-you-cry false "+
- "--no-tell-a-lie "+
- "--no-no-and-hurt-you false"
- ,{"strangers-to-love":false
- ,"you-know":"the-rules"
- ,"and":"so-do-i"
- ,"you-would-get-this-from-any-other-guy":false
- ,"gonna-give-you-up":false
- ,"gonna-let-you-down":false
- ,"gonna-run-around":false
- ,"desert-you":false
- ,"make-you-cry":false
- ,"tell-a-lie":false
- ,"and-hurt-you":false
- },["we", "are"]]
- ,["-t one -t two -t three"
- ,{t: ["one", "two", "three"]}
- ,[]]
- ,["-t one -t null -t three four five null"
- ,{t: ["one", "null", "three"]}
- ,["four", "five", "null"]]
- ,["-t foo"
- ,{t:["foo"]}
- ,[]]
- ,["--no-t"
- ,{t:["false"]}
- ,[]]
- ,["-no-no-t"
- ,{t:["true"]}
- ,[]]
- ,["-aoa one -aoa null -aoa 100"
- ,{aoa:["one", null, 100]}
- ,[]]
- ,["-str 100"
- ,{str:"100"}
- ,[]]
- ,["--color always"
- ,{color:"always"}
- ,[]]
- ,["--no-nullstream"
- ,{nullstream:null}
- ,[]]
- ,["--nullstream false"
- ,{nullstream:null}
- ,[]]
- ,["--notadate=2011-01-25"
- ,{notadate: "2011-01-25"}
- ,[]]
- ,["--date 2011-01-25"
- ,{date: new Date("2011-01-25")}
- ,[]]
- ,["-cl 1"
- ,{config: true, length: 1}
- ,[]
- ,{config: Boolean, length: Number, clear: Boolean}
- ,{c: "--config", l: "--length"}]
- ,["--acount bla"
- ,{"acount":true}
- ,["bla"]
- ,{account: Boolean, credentials: Boolean, options: String}
- ,{a:"--account", c:"--credentials",o:"--options"}]
- ,["--clear"
- ,{clear:true}
- ,[]
- ,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean}
- ,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}]
- ,["--file -"
- ,{"file":"-"}
- ,[]
- ,{file:String}
- ,{}]
- ,["--file -"
- ,{"file":true}
- ,["-"]
- ,{file:Boolean}
- ,{}]
- ].forEach(function (test) {
- var argv = test[0].split(/\s+/)
- , opts = test[1]
- , rem = test[2]
- , actual = nopt(test[3] || types, test[4] || shorthands, argv, 0)
- , parsed = actual.argv
- delete actual.argv
- console.log(util.inspect(actual, false, 2, true), parsed.remain)
- for (var i in opts) {
- var e = JSON.stringify(opts[i])
- , a = JSON.stringify(actual[i] === undefined ? null : actual[i])
- if (e && typeof e === "object") {
- assert.deepEqual(e, a)
- } else {
- assert.equal(e, a)
- }
- }
- assert.deepEqual(rem, parsed.remain)
- })
-}
{
"name": "nopt",
- "version": "2.1.2",
+ "version": "2.2.0",
"description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.",
"author": {
"name": "Isaac Z. Schlueter",
},
"main": "lib/nopt.js",
"scripts": {
- "test": "node lib/nopt.js"
+ "test": "tap test/*.js"
},
"repository": {
"type": "git",
"dependencies": {
"abbrev": "1"
},
- "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many\" : [String, Array]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk 1000 -fp # unknown opts are ok.\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --blatzk true -fp # but they need a value\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents, and numeric values will be\ninterpreted as a number.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null. When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n",
+ "devDependencies": {
+ "tap": "~0.4.8"
+ },
+ "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many\" : [String, Array]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk -fp # unknown opts are ok.\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents, and numeric values will be\ninterpreted as a number.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null. When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/nopt/issues"
},
- "_id": "nopt@2.1.2",
+ "homepage": "https://github.com/isaacs/nopt",
+ "_id": "nopt@2.2.0",
"_from": "nopt@latest"
}
--- /dev/null
+var nopt = require("../")
+ , test = require('tap').test
+
+
+test("passing a string results in a string", function (t) {
+ var parsed = nopt({ key: String }, {}, ["--key", "myvalue"], 0)
+ t.same(parsed.key, "myvalue")
+ t.end()
+})
+
+// https://github.com/npm/nopt/issues/31
+test("Empty String results in empty string, not true", function (t) {
+ var parsed = nopt({ empty: String }, {}, ["--empty"], 0)
+ t.same(parsed.empty, "")
+ t.end()
+})
+
+test("other tests", function (t) {
+
+ var util = require("util")
+ , Stream = require("stream")
+ , path = require("path")
+ , url = require("url")
+
+ , shorthands =
+ { s : ["--loglevel", "silent"]
+ , d : ["--loglevel", "info"]
+ , dd : ["--loglevel", "verbose"]
+ , ddd : ["--loglevel", "silly"]
+ , noreg : ["--no-registry"]
+ , reg : ["--registry"]
+ , "no-reg" : ["--no-registry"]
+ , silent : ["--loglevel", "silent"]
+ , verbose : ["--loglevel", "verbose"]
+ , h : ["--usage"]
+ , H : ["--usage"]
+ , "?" : ["--usage"]
+ , help : ["--usage"]
+ , v : ["--version"]
+ , f : ["--force"]
+ , desc : ["--description"]
+ , "no-desc" : ["--no-description"]
+ , "local" : ["--no-global"]
+ , l : ["--long"]
+ , p : ["--parseable"]
+ , porcelain : ["--parseable"]
+ , g : ["--global"]
+ }
+
+ , types =
+ { aoa: Array
+ , nullstream: [null, Stream]
+ , date: Date
+ , str: String
+ , browser : String
+ , cache : path
+ , color : ["always", Boolean]
+ , depth : Number
+ , description : Boolean
+ , dev : Boolean
+ , editor : path
+ , force : Boolean
+ , global : Boolean
+ , globalconfig : path
+ , group : [String, Number]
+ , gzipbin : String
+ , logfd : [Number, Stream]
+ , loglevel : ["silent","win","error","warn","info","verbose","silly"]
+ , long : Boolean
+ , "node-version" : [false, String]
+ , npaturl : url
+ , npat : Boolean
+ , "onload-script" : [false, String]
+ , outfd : [Number, Stream]
+ , parseable : Boolean
+ , pre: Boolean
+ , prefix: path
+ , proxy : url
+ , "rebuild-bundle" : Boolean
+ , registry : url
+ , searchopts : String
+ , searchexclude: [null, String]
+ , shell : path
+ , t: [Array, String]
+ , tag : String
+ , tar : String
+ , tmp : path
+ , "unsafe-perm" : Boolean
+ , usage : Boolean
+ , user : String
+ , username : String
+ , userconfig : path
+ , version : Boolean
+ , viewer: path
+ , _exit : Boolean
+ , path: path
+ }
+
+ ; [["-v", {version:true}, []]
+ ,["---v", {version:true}, []]
+ ,["ls -s --no-reg connect -d",
+ {loglevel:"info",registry:null},["ls","connect"]]
+ ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]]
+ ,["ls --registry blargle", {}, ["ls"]]
+ ,["--no-registry", {registry:null}, []]
+ ,["--no-color true", {color:false}, []]
+ ,["--no-color false", {color:true}, []]
+ ,["--no-color", {color:false}, []]
+ ,["--color false", {color:false}, []]
+ ,["--color --logfd 7", {logfd:7,color:true}, []]
+ ,["--color=true", {color:true}, []]
+ ,["--logfd=10", {logfd:10}, []]
+ ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]]
+ ,["--tmp=tmp -tar=gtar",
+ {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]]
+ ,["--logfd x", {}, []]
+ ,["a -true -- -no-false", {true:true},["a","-no-false"]]
+ ,["a -no-false", {false:false},["a"]]
+ ,["a -no-no-true", {true:true}, ["a"]]
+ ,["a -no-no-no-false", {false:false}, ["a"]]
+ ,["---NO-no-No-no-no-no-nO-no-no"+
+ "-No-no-no-no-no-no-no-no-no"+
+ "-no-no-no-no-NO-NO-no-no-no-no-no-no"+
+ "-no-body-can-do-the-boogaloo-like-I-do"
+ ,{"body-can-do-the-boogaloo-like-I-do":false}, []]
+ ,["we are -no-strangers-to-love "+
+ "--you-know=the-rules --and=so-do-i "+
+ "---im-thinking-of=a-full-commitment "+
+ "--no-you-would-get-this-from-any-other-guy "+
+ "--no-gonna-give-you-up "+
+ "-no-gonna-let-you-down=true "+
+ "--no-no-gonna-run-around false "+
+ "--desert-you=false "+
+ "--make-you-cry false "+
+ "--no-tell-a-lie "+
+ "--no-no-and-hurt-you false"
+ ,{"strangers-to-love":false
+ ,"you-know":"the-rules"
+ ,"and":"so-do-i"
+ ,"you-would-get-this-from-any-other-guy":false
+ ,"gonna-give-you-up":false
+ ,"gonna-let-you-down":false
+ ,"gonna-run-around":false
+ ,"desert-you":false
+ ,"make-you-cry":false
+ ,"tell-a-lie":false
+ ,"and-hurt-you":false
+ },["we", "are"]]
+ ,["-t one -t two -t three"
+ ,{t: ["one", "two", "three"]}
+ ,[]]
+ ,["-t one -t null -t three four five null"
+ ,{t: ["one", "null", "three"]}
+ ,["four", "five", "null"]]
+ ,["-t foo"
+ ,{t:["foo"]}
+ ,[]]
+ ,["--no-t"
+ ,{t:["false"]}
+ ,[]]
+ ,["-no-no-t"
+ ,{t:["true"]}
+ ,[]]
+ ,["-aoa one -aoa null -aoa 100"
+ ,{aoa:["one", null, 100]}
+ ,[]]
+ ,["-str 100"
+ ,{str:"100"}
+ ,[]]
+ ,["--color always"
+ ,{color:"always"}
+ ,[]]
+ ,["--no-nullstream"
+ ,{nullstream:null}
+ ,[]]
+ ,["--nullstream false"
+ ,{nullstream:null}
+ ,[]]
+ ,["--notadate=2011-01-25"
+ ,{notadate: "2011-01-25"}
+ ,[]]
+ ,["--date 2011-01-25"
+ ,{date: new Date("2011-01-25")}
+ ,[]]
+ ,["-cl 1"
+ ,{config: true, length: 1}
+ ,[]
+ ,{config: Boolean, length: Number, clear: Boolean}
+ ,{c: "--config", l: "--length"}]
+ ,["--acount bla"
+ ,{"acount":true}
+ ,["bla"]
+ ,{account: Boolean, credentials: Boolean, options: String}
+ ,{a:"--account", c:"--credentials",o:"--options"}]
+ ,["--clear"
+ ,{clear:true}
+ ,[]
+ ,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean}
+ ,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}]
+ ,["--file -"
+ ,{"file":"-"}
+ ,[]
+ ,{file:String}
+ ,{}]
+ ,["--file -"
+ ,{"file":true}
+ ,["-"]
+ ,{file:Boolean}
+ ,{}]
+ ,["--path"
+ ,{"path":null}
+ ,[]]
+ ,["--path ."
+ ,{"path":process.cwd()}
+ ,[]]
+ ].forEach(function (test) {
+ var argv = test[0].split(/\s+/)
+ , opts = test[1]
+ , rem = test[2]
+ , actual = nopt(test[3] || types, test[4] || shorthands, argv, 0)
+ , parsed = actual.argv
+ delete actual.argv
+ for (var i in opts) {
+ var e = JSON.stringify(opts[i])
+ , a = JSON.stringify(actual[i] === undefined ? null : actual[i])
+ if (e && typeof e === "object") {
+ t.deepEqual(e, a)
+ } else {
+ t.equal(e, a)
+ }
+ }
+ t.deepEqual(rem, parsed.remain)
+ })
+ t.end()
+})
this.log.verbose("adduser", "update existing user")
return this.request('GET'
- , '/-/user/org.couchdb.user:'+encodeURIComponent(username)
+ , '/-/user/org.couchdb.user:'+encodeURIComponent(username) +
+ '?write=true'
, function (er, data, json, response) {
if (er || data.error) {
return cb(er, data, json, response)
var users = {}
- this.get(name, function (er, data) {
+ this.get(name + '?write=true', function (er, data) {
if (er) return cb(er)
// filter all the versions that match
Object.keys(data.versions).filter(function (v) {
var cacheUri = uri
// on windows ":" is not an allowed character in a foldername
- cacheUri = cacheUri.replace(/:/g, '_')
+ cacheUri = cacheUri.replace(/:/g, '_').replace(/\?write=true$/, '')
var cache = path.join(this.conf.get('cache'), cacheUri, ".cache.json")
+ // If the GET is part of a write operation (PUT or DELETE), then
+ // skip past the cache entirely, but still save the results.
+ if (uri.match(/\?write=true$/))
+ return get_.call(this, uri, timeout, cache, null, null, nofollow, staleOk, cb)
+
+
fs.stat(cache, function (er, stat) {
if (!er) fs.readFile(cache, function (er, data) {
try { data = JSON.parse(data) }
return cb(er)
}
- if (data.name !== encodeURIComponent(data.name).toLowerCase())
- return cb(new Error('invalid name: must be lowercase and url-safe'))
+ if (data.name !== encodeURIComponent(data.name))
+ return cb(new Error('invalid name: must be url-safe'))
var ver = semver.clean(data.version)
if (!ver)
return cb(er, parsed, json, res)
// let's see what versions are already published.
- this.request("GET", data.name, function (er, current) {
+ var getUrl = data.name + "?write=true"
+ this.request("GET", getUrl, function (er, current) {
if (er)
return cb(er)
putNext.call(this, data.version, root, current, cb)
var users = {}
- this.request("GET", package, function (er, fullData) {
+ this.request("GET", package + '?write=true', function (er, fullData) {
if (er) return cb(er)
fullData = { _id: fullData._id
function unpublish (name, ver, cb) {
if (typeof cb !== "function") cb = ver, ver = null
- this.get(name, null, -1, true, function (er, data) {
+ var u = name + '?write=true'
+ this.get(u, null, -1, true, function (er, data) {
if (er) {
this.log.info("unpublish", name+" not published")
return cb()
},
"name": "npm-registry-client",
"description": "Client for the npm registry",
- "version": "0.4.0",
+ "version": "0.4.4",
"repository": {
"url": "git://github.com/isaacs/npm-registry-client"
},
"url": "https://github.com/isaacs/npm-registry-client/issues"
},
"homepage": "https://github.com/isaacs/npm-registry-client",
- "_id": "npm-registry-client@0.4.0",
- "dist": {
- "shasum": "30d0c178b7f2e54183a6a3fc9fe4071eb10290bf"
- },
- "_from": "npm-registry-client@0.4.0",
- "_resolved": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-0.4.0.tgz"
+ "_id": "npm-registry-client@0.4.4",
+ "_from": "npm-registry-client@latest"
}
res.json({error: "conflict"})
})
- server.expect("GET", "/-/user/org.couchdb.user:username", function (req, res) {
+ server.expect("GET", "/-/user/org.couchdb.user:username?write=true", function (req, res) {
t.equal(req.method, "GET")
res.json(userdata)
})
})
})
- server.expect("/npm-registry-client", function (req, res) {
+ server.expect("/npm-registry-client?write=true", function (req, res) {
t.equal(req.method, "GET")
t.ok(lastTime)
for (var i in lastTime.versions) {
npm uses this.
+## 1.0.0
+
+Breaking changes in `1.0.0`:
+
+The second argument is now an `Object` that contains the following keys:
+
+ * `depth` optional, defaults to Infinity
+ * `log` optional log Function
+ * `dev` optional, dev=true to mark devDeps as extraneous
+
## Usage
```javascript
var readInstalled = require("read-installed")
-// depth is optional, defaults to Infinity
-readInstalled(folder, depth, logFunction, function (er, data) {
+readInstalled(folder, { depth, log, dev }, function (er, data) {
...
})
```
{
"name": "read-installed",
"description": "Read all the installed packages in a folder, and return a tree structure with all the data.",
- "version": "0.2.5",
+ "version": "1.0.0",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/read-installed"
},
"main": "read-installed.js",
"scripts": {
- "test": "node test/basic.js"
+ "test": "tap ./test/"
},
"dependencies": {
"semver": "2",
"slide": "~1.1.3",
- "read-package-json": "1"
+ "read-package-json": "1",
+ "graceful-fs": "~2"
},
"optionalDependencies": {
"graceful-fs": "~2"
},
- "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
- "license": "ISC"
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me/"
+ },
+ "license": "ISC",
+ "devDependencies": {
+ "tap": "~0.4.8"
+ },
+ "readme": "# read-installed\n\nRead all the installed packages in a folder, and return a tree\nstructure with all the data.\n\nnpm uses this.\n\n## 1.0.0\n\nBreaking changes in `1.0.0`:\n\nThe second argument is now an `Object` that contains the following keys:\n\n * `depth` optional, defaults to Infinity\n * `log` optional log Function\n * `dev` optional, dev=true to mark devDeps as extraneous\n\n## Usage\n\n```javascript\nvar readInstalled = require(\"read-installed\")\nreadInstalled(folder, { depth, log, dev }, function (er, data) {\n ...\n})\n```\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/isaacs/read-installed/issues"
+ },
+ "homepage": "https://github.com/isaacs/read-installed",
+ "_id": "read-installed@1.0.0",
+ "_from": "read-installed@latest"
}
module.exports = readInstalled
-function readInstalled (folder, depth_, log_, cb_) {
- var depth = Infinity, log = function () {}, cb
- for (var i = 1; i < arguments.length - 1; i++) {
- if (typeof arguments[i] === 'number')
- depth = arguments[i]
- else if (typeof arguments[i] === 'function')
- log = arguments[i]
+function readInstalled (folder, opts, cb) {
+ if (typeof opts === 'function') {
+ cb = opts
+ opts = {}
}
- cb = arguments[i]
+ var depth = Infinity || opts.depth, log = function () {} || opts.log, dev = false || opts.dev
- readInstalled_(folder, null, null, null, 0, depth, function (er, obj) {
+ readInstalled_(folder, null, null, null, 0, depth, dev, function (er, obj) {
if (er) return cb(er)
// now obj has all the installed things, where they're installed
// figure out the inheritance links, now that the object is built.
}
var rpSeen = {}
-function readInstalled_ (folder, parent, name, reqver, depth, maxDepth, cb) {
+function readInstalled_ (folder, parent, name, reqver, depth, maxDepth, dev, cb) {
var installed
, obj
, real
obj.realName = name || obj.name
obj.dependencies = obj.dependencies || {}
- // "foo":"http://blah" is always presumed valid
+ // "foo":"http://blah" and "foo":"latest" are always presumed valid
if (reqver
&& semver.validRange(reqver, true)
&& !semver.satisfies(obj.version, reqver, true)) {
if (parent
&& !(name in parent.dependencies)
- && !(name in (parent.devDependencies || {}))) {
+ && (dev || !(name in (parent.devDependencies || {})))) {
obj.extraneous = true
}
obj.path = obj.path || folder
//if (depth >= maxDepth) return cb(null, obj)
asyncMap(installed, function (pkg, cb) {
var rv = obj.dependencies[pkg]
- if (!rv && obj.devDependencies) rv = obj.devDependencies[pkg]
+ if (!rv && obj.devDependencies && !dev) rv = obj.devDependencies[pkg]
if (depth >= maxDepth) {
// just try to get the version number
var pkgfolder = path.resolve(folder, "node_modules", pkg)
readInstalled_( path.resolve(folder, "node_modules/"+pkg)
, obj, pkg, obj.dependencies[pkg], depth + 1, maxDepth
+ , dev
, cb )
}, function (er, installedData) {
r = r.link ? null : r.parent
continue
}
+ // "foo":"http://blah" and "foo":"latest" are always presumed valid
if ( typeof deps[d] === "string"
- // url deps presumed innocent.
- && !url.parse(deps[d]).protocol
+ && semver.validRange(deps[d], true)
&& !semver.satisfies(found.version, deps[d], true)) {
// the bad thing will happen
log("unmet dependency", obj.path + " requires "+d+"@'"+deps[d]
var readInstalled = require("../read-installed.js")
-var util = require("util")
-console.error("testing")
+var json = require("../package.json")
+var known = [].concat(Object.keys(json.dependencies)
+ , Object.keys(json.optionalDependencies)
+ , Object.keys(json.devDependencies)).sort()
+var test = require("tap").test
+var path = require("path")
-var called = 0
-readInstalled(process.cwd(), console.error, function (er, map) {
- console.error(called ++)
- if (er) return console.error(er.stack || er.message)
- cleanup(map)
- console.error(util.inspect(map, true, 10, true))
+test("make sure that it works", function (t) {
+ readInstalled(path.join(__dirname, "../"), {
+ log: console.error
+ }, function (er, map) {
+ t.notOk(er, "er should be bull")
+ t.ok(map, "map should be data")
+ if (er) return console.error(er.stack || er.message)
+ cleanup(map)
+ var deps = Object.keys(map.dependencies).sort()
+ t.equal(known.length, deps.length, "array lengths are equal")
+ t.deepEqual(known, deps, "arrays should be equal")
+ t.notOk(map.dependencies.tap.extraneous, 'extraneous not set on devDep')
+ t.end()
+ })
})
-
var seen = []
function cleanup (map) {
if (seen.indexOf(map) !== -1) return
--- /dev/null
+var readInstalled = require("../read-installed.js")
+var test = require("tap").test
+var json = require("../package.json")
+var path = require("path")
+var known = [].concat(Object.keys(json.dependencies)
+ , Object.keys(json.optionalDependencies)
+ , Object.keys(json.devDependencies)).sort()
+
+test("make sure that it works without dev deps", function (t) {
+ readInstalled(path.join(__dirname, "../"), {
+ log: console.error
+ , dev: true }, function (er, map) {
+ t.notOk(er, "er should be bull")
+ t.ok(map, "map should be data")
+ if (er) return console.error(er.stack || er.message)
+ var deps = Object.keys(map.dependencies).sort()
+ t.equal(deps.length, known.length, "array lengths are equal")
+ t.deepEqual(deps, known, "arrays should be equal")
+ t.ok(map.dependencies.tap.extraneous, 'extraneous is set on devDep')
+ t.end()
+ })
+})
--- /dev/null
+{
+ "name": "strong-task-emitter",
+ "version": "0.0.4",
+ "dependencies": {
+ "debug": "latest"
+ },
+ "_id": "strong-task-emitter@0.0.4",
+ "_from": "strong-task-emitter@0.0.4",
+ "_resolved": "https://registry.npmjs.org/strong-task-emitter/-/strong-task-emitter-0.0.4.tgz"
+}
--- /dev/null
+var readInstalled = require("../read-installed.js")
+var test = require("tap").test
+var json = require("../package.json")
+var path = require("path")
+var known = [].concat(Object.keys(json.dependencies)
+ , Object.keys(json.optionalDependencies)
+ , Object.keys(json.devDependencies)).sort()
+
+test("make sure that it works without dev deps", function (t) {
+ readInstalled(path.join(__dirname, "../"), function (er, map) {
+ t.notOk(er, "er should be bull")
+ t.ok(map, "map should be data")
+ if (er) return console.error(er.stack || er.message)
+ var deps = Object.keys(map.dependencies).sort()
+ t.equal(deps.length, known.length, "array lengths are equal")
+ t.deepEqual(deps, known, "arrays should be equal")
+ t.notOk(map.dependencies.tap.extraneous, 'extraneous is set on devDep')
+ t.end()
+ })
+})
+
--- /dev/null
+var readInstalled = require('../read-installed.js')
+var test = require('tap').test
+var path = require('path');
+
+test('"latest" version is valid', function(t) {
+ // This test verifies npm#3860
+ readInstalled(
+ path.join(__dirname, 'fixtures/peer-at-latest'),
+ { log: console.error },
+ function(err, map) {
+ t.notOk(map.dependencies.debug.invalid, 'debug@latest is satisfied by a peer')
+ t.end()
+ })
+})
{
- "version": "1.4.0",
+ "version": "1.4.3",
"name": "npm",
"publishConfig": {
"proprietary-attribs": false
"ini": "~1.1.0",
"slide": "~1.1.5",
"abbrev": "~1.0.4",
- "graceful-fs": "~2.0.0",
+ "graceful-fs": "^2.0.2",
"minimatch": "~0.2.14",
- "nopt": "~2.1.2",
+ "nopt": "^2.2.0",
"rimraf": "~2.2.5",
"request": "~2.30.0",
"which": "1",
"chownr": "0",
"npmlog": "0.0.6",
"ansi": "~0.2.1",
- "npm-registry-client": "~0.4.0",
+ "npm-registry-client": "^0.4.4",
"read-package-json": "~1.1.7",
- "read-installed": "~0.2.2",
- "glob": "~3.2.6",
+ "read-installed": "~1.0.0",
+ "glob": "3.2.7",
"init-package-json": "0.0.14",
"osenv": "0",
"lockfile": "~0.4.0",
# on some systems, you can just do cat>npm-install.sh
# which is a bit cuter. But on others, &1 is already closed,
# so catting to another script file won't do anything.
- curl -s https://npmjs.org/install.sh > npm-install-$$.sh
+ # Follow Location: headers, and fail on errors
+ curl -f -L -s https://www.npmjs.org/install.sh > npm-install-$$.sh
+ ret=$?
+ if [ $ret -eq 0 ]; then
+ (exit 0)
+ else
+ rm npm-install-$$.sh
+ echo "Failed to download script" >&2
+ exit $ret
+ fi
sh npm-install-$$.sh
ret=$?
rm npm-install-$$.sh
, rimraf = require("rimraf")
test("dedupe finds the common module and moves it up one level", function (t) {
- t.plan(1)
+ t.plan(2)
setup(function () {
npm.install(".", function (err) {
npm.dedupe(function(err) {
if (err) return t.fail(err)
t.ok(existsSync(path.join(__dirname, "dedupe", "node_modules", "minimist")))
+ t.ok(!existsSync(path.join(__dirname, "dedupe", "node_modules", "prime")))
})
})
})
"version": "0.0.0",
"dependencies": {
"optimist": "0.6.0",
- "clean": "2.1.6"
+ "clean": "2.1.6",
+ "informal": "0.0.1",
+ "pathogen": "0.1.5"
}
}
--- /dev/null
+var test = require("tap").test
+ , path = require("path")
+ , rimraf = require("rimraf")
+ , mkdirp = require("mkdirp")
+ , spawn = require("child_process").spawn
+ , npm = require.resolve("../../bin/npm-cli.js")
+ , node = process.execPath
+ , pkg = path.resolve(__dirname, "git-cache-locking")
+ , tmp = path.join(pkg, "tmp")
+ , cache = path.join(pkg, "cache")
+
+test("git-cache-locking: install a git dependency", function (t) {
+ t.plan(1)
+
+ cleanup()
+ mkdirp.sync(cache)
+ mkdirp.sync(tmp)
+
+ // package c depends on a.git#master and b.git#master
+ // package b depends on a.git#master
+ var child = spawn(node, [npm, "install", "git://github.com/nigelzor/npm-4503-c.git"], {
+ cwd: pkg,
+ env: {
+ npm_config_cache: cache,
+ npm_config_tmp: tmp,
+ npm_config_prefix: pkg,
+ npm_config_global: "false",
+ HOME: process.env.HOME,
+ Path: process.env.PATH,
+ PATH: process.env.PATH
+ },
+ stdio: "inherit"
+ })
+
+ child.on("close", function (code) {
+ t.equal(0, code, "npm install should succeed")
+ cleanup()
+ })
+})
+
+function cleanup() {
+ rimraf.sync(pkg)
+}
--- /dev/null
+var common = require('../common-tap.js')
+var test = require('tap').test
+var npm = require('../../')
+var osenv = require('osenv')
+var path = require('path')
+var fs = require('fs')
+var rimraf = require('rimraf')
+var mkdirp = require('mkdirp')
+var pkg = path.join(__dirname, 'install-at-locally')
+
+test("setup", function (t) {
+ mkdirp.sync(pkg)
+ mkdirp.sync(path.resolve(pkg, 'node_modules'))
+ process.chdir(pkg)
+ t.end()
+})
+
+test('"npm install ./package@1.2.3" should install local pkg', function(t) {
+ npm.load(function() {
+ npm.commands.install(['./package@1.2.3'], function(err) {
+ var p = path.resolve(pkg, 'node_modules/install-at-locally/package.json')
+ t.ok(JSON.parse(fs.readFileSync(p, 'utf8')))
+ t.end()
+ })
+ })
+})
+
+test('"npm install install/at/locally@./package@1.2.3" should install local pkg', function(t) {
+ npm.load(function() {
+ npm.commands.install(['./package@1.2.3'], function(err) {
+ var p = path.resolve(pkg, 'node_modules/install-at-locally/package.json')
+ t.ok(JSON.parse(fs.readFileSync(p, 'utf8')))
+ t.end()
+ })
+ })
+})
+
+test('cleanup', function(t) {
+ process.chdir(__dirname)
+ rimraf.sync(path.resolve(pkg, 'node_modules'))
+ t.end()
+})
+
--- /dev/null
+{
+ "name": "install-at-locally",
+ "version": "0.0.0",
+ "description": "Test for 404-parent"
+}
--- /dev/null
+var test = require("tap").test
+var npm = require("../..")
+var path = require("path")
+var rimraf = require("rimraf")
+var npmrc = path.join(__dirname, "npmrc")
+var fs = require("fs")
+
+test("setup", function (t) {
+ fs.writeFileSync(npmrc, "foo = bar\n", "ascii")
+ t.end()
+})
+
+test("calling set/get on config pre-load should throw", function (t) {
+ var threw = true
+ try {
+ npm.config.get("foo")
+ threw = false
+ } catch (er) {
+ t.equal(er.message, "npm.load() required")
+ } finally {
+ t.ok(threw, "get before load should throw")
+ }
+
+ var threw = true
+ try {
+ npm.config.set("foo", "bar")
+ threw = false
+ } catch (er) {
+ t.equal(er.message, "npm.load() required")
+ } finally {
+ t.ok(threw, "set before load should throw")
+ }
+
+ npm.load({ userconfig: npmrc }, function (er) {
+ if (er)
+ throw er
+ t.equal(npm.config.get("foo"), "bar")
+ npm.config.set("foo", "baz")
+ t.equal(npm.config.get("foo"), "baz")
+ t.end()
+ })
+})
+
+test("cleanup", function (t) {
+ rimraf.sync(npmrc)
+ t.end()
+})
--- /dev/null
+var common = require("../common-tap.js")
+var test = require("tap").test
+var npm = require("../../")
+var mkdirp = require("mkdirp")
+var rimraf = require("rimraf")
+var mr = require("npm-registry-mock")
+var exec = require('child_process').exec
+
+var pkg = __dirname + '/outdated'
+var NPM_BIN = __dirname + '/../../bin/npm-cli.js'
+mkdirp.sync(pkg + "/cache")
+
+function hasControlCodes(str) {
+ return str.length !== ansiTrim(str).length
+}
+
+function ansiTrim (str) {
+ var r = new RegExp("\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|" +
+ "\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g");
+ return str.replace(r, "")
+}
+
+// note hard to automate tests for color = true
+// as npm kills the color config when it detects
+// it's not running in a tty
+test("does not use ansi styling", function (t) {
+ t.plan(3)
+ exec('node ' + NPM_BIN + ' outdated --color false', {
+ cwd: pkg
+ }, function(err, stdout) {
+ t.ifError(err)
+ t.ok(stdout, stdout.length)
+ t.ok(!hasControlCodes(stdout))
+ })
+})
+
+test("cleanup", function (t) {
+ rimraf.sync(pkg + "/cache")
+ t.end()
+})
+
test("dicovers new versions in outdated", function (t) {
process.chdir(pkg)
- t.plan(4)
+ t.plan(5)
npm.load({cache: pkg + "/cache", registry: common.registry}, function () {
npm.outdated(function (er, d) {
t.equal('git', d[0][3])
t.equal('git', d[0][4])
t.equal('git://github.com/robertkowalski/foo-private.git', d[0][5])
t.equal('git://user:pass@github.com/robertkowalski/foo-private.git', d[1][5])
+ t.equal('git://github.com/robertkowalski/foo', d[2][5])
})
})
})
"main": "index.js",
"dependencies": {
"foo-private": "git://github.com/robertkowalski/foo-private.git",
- "foo-private-credentials": "git://user:pass@github.com/robertkowalski/foo-private.git"
+ "foo-private-credentials": "git://user:pass@github.com/robertkowalski/foo-private.git",
+ "foo-github": "robertkowalski/foo"
}
}
// config
var pkg = __dirname + '/outdated'
+var path = require("path")
+
test("it should not throw", function (t) {
cleanup()
process.chdir(pkg)
+ var originalLog = console.log
+ var output = []
+ var expOut = [ path.resolve(__dirname, "outdated/node_modules/underscore")
+ , path.resolve(__dirname, "outdated/node_modules/underscore")
+ + ":underscore@1.3.1"
+ + ":underscore@1.3.1"
+ + ":underscore@1.5.1" ]
+ var expData = [ [ path.resolve(__dirname, "outdated")
+ , "underscore"
+ , "1.3.1"
+ , "1.3.1"
+ , "1.5.1"
+ , "1.3.1" ] ]
+
+ console.log = function () {
+ output.push.apply(output, arguments)
+ }
mr(common.port, function (s) {
npm.load({
cache: pkg + "/cache",
loglevel: 'silent',
+ parseable: true,
registry: common.registry }
, function () {
npm.install(".", function (err) {
npm.outdated(function (er, d) {
- console.log(d)
+ console.log = originalLog
+ t.same(output, expOut)
+ t.same(d, expData)
s.close()
t.end()
})
--- /dev/null
+var test = require("tap").test
+var fs = require("fs")
+var node = process.execPath
+var npm = require.resolve("../../bin/npm-cli.js")
+var rimraf = require("rimraf")
+var mr = require("npm-registry-mock")
+var common = require("../common-tap.js")
+var spawn = require("child_process").spawn
+
+var pkg = __dirname + "/prune"
+
+var server
+
+test("reg mock", function (t) {
+ mr(common.port, function (s) {
+ server = s
+ t.pass("registry mock started")
+ t.end()
+ })
+})
+
+test("npm install", function (t) {
+ var c = spawn(node, [
+ npm, "install",
+ "--registry=" + common.registry,
+ "--loglevel=silent",
+ "--production=false"
+ ], { cwd: pkg })
+ c.stderr.on("data", function(d) {
+ t.fail("Should not get data on stderr: " + d)
+ })
+ c.on("close", function(code) {
+ t.notOk(code, "exit ok")
+ t.end()
+ })
+})
+
+test("npm install test-package", function (t) {
+ var c = spawn(node, [
+ npm, "install", "test-package",
+ "--registry=" + common.registry,
+ "--loglevel=silent",
+ "--production=false"
+ ], { cwd: pkg })
+ c.stderr.on("data", function(d) {
+ t.fail("Should not get data on stderr: " + d)
+ })
+ c.on("close", function(code) {
+ t.notOk(code, "exit ok")
+ t.end()
+ })
+})
+
+test("verify installs", function (t) {
+ var dirs = fs.readdirSync(pkg + "/node_modules").sort()
+ t.same(dirs, [ "test-package", "mkdirp", "underscore" ].sort())
+ t.end()
+})
+
+test("npm prune", function (t) {
+ var c = spawn(node, [
+ npm, "prune",
+ "--loglevel=silent",
+ "--production=false"
+ ], { cwd: pkg })
+ c.stderr.on("data", function(d) {
+ t.fail("Should not get data on stderr: " + d)
+ })
+ c.on("close", function(code) {
+ t.notOk(code, "exit ok")
+ t.end()
+ })
+})
+
+test("verify installs", function (t) {
+ var dirs = fs.readdirSync(pkg + "/node_modules").sort()
+ t.same(dirs, [ "mkdirp", "underscore" ])
+ t.end()
+})
+
+test("npm prune", function (t) {
+ var c = spawn(node, [
+ npm, "prune",
+ "--loglevel=silent",
+ "--production"
+ ], { cwd: pkg })
+ c.stderr.on("data", function(d) {
+ t.fail("Should not get data on stderr: " + d)
+ })
+ c.on("close", function(code) {
+ t.notOk(code, "exit ok")
+ t.end()
+ })
+})
+
+test("verify installs", function (t) {
+ var dirs = fs.readdirSync(pkg + "/node_modules").sort()
+ t.same(dirs, [ "underscore" ])
+ t.end()
+})
+
+test("cleanup", function (t) {
+ server.close()
+ rimraf.sync(pkg + "/node_modules")
+ t.pass("cleaned up")
+ t.end()
+})
--- /dev/null
+{
+ "name": "bla",
+ "description": "fixture",
+ "version": "0.0.1",
+ "main": "index.js",
+ "dependencies": {
+ "underscore": "1.3.1"
+ },
+ "devDependencies": {
+ "mkdirp": "*"
+ },
+ "repository": "git://github.com/robertkowalski/bogusfixture"
+}
--- /dev/null
+if (process.platform === "win32") {
+ console.error("skipping test, because windows and shebangs")
+ return
+}
+
+var common = require("../common-tap.js")
+var mr = require("npm-registry-mock")
+
+var test = require("tap").test
+var npm = require.resolve("../../bin/npm-cli.js")
+var node = process.execPath
+var rimraf = require("rimraf")
+var spawn = require("child_process").spawn
+var fs = require("fs")
+
+test("setup", function (t) {
+ var s = "#!/usr/bin/env bash\n" +
+ "echo \"$@\" > " + JSON.stringify(__dirname) + "/_output\n"
+ fs.writeFileSync(__dirname + "/_script.sh", s, "ascii")
+ fs.chmodSync(__dirname + "/_script.sh", "0755")
+ t.pass("made script")
+ t.end()
+})
+
+test("npm repo underscore", function (t) {
+ mr(common.port, function (s) {
+ var c = spawn(node, [
+ npm, "repo", "underscore",
+ "--registry=" + common.registry,
+ "--loglevel=silent",
+ "--browser=" + __dirname + "/_script.sh",
+ ])
+ c.stdout.on("data", function(d) {
+ t.fail("Should not get data on stdout: " + d)
+ })
+ c.stderr.pipe(process.stderr)
+ c.on("close", function(code) {
+ t.equal(code, 0, "exit ok")
+ var res = fs.readFileSync(__dirname + "/_output", "ascii")
+ s.close()
+ t.equal(res, "https://github.com/jashkenas/underscore\n")
+ t.end()
+ })
+ })
+})
+
+test("cleanup", function (t) {
+ fs.unlinkSync(__dirname + "/_script.sh")
+ fs.unlinkSync(__dirname + "/_output")
+ t.pass("cleaned up")
+ t.end()
+})
--- /dev/null
+var npm = npm = require("../../")
+var test = require("tap").test
+var path = require("path")
+var fs = require("fs")
+var osenv = require("osenv")
+var rimraf = require("rimraf")
+var mr = require("npm-registry-mock")
+var common = require("../common-tap.js")
+
+var pkg = path.resolve(__dirname, "shrinkwrap-dev-dependency")
+var desiredResultsPath = path.resolve(pkg, "desired-shrinkwrap-results.json")
+
+test("shrinkwrap doesn't strip out the dependency", function (t) {
+ t.plan(1)
+
+ mr(common.port, function (s) {
+ setup({ production: true }, function (err) {
+ if (err) return t.fail(err)
+
+ npm.install(".", function (err) {
+ if (err) return t.fail(err)
+
+ npm.commands.shrinkwrap([], true, function (err, results) {
+ if (err) return t.fail(err)
+
+ fs.readFile(desiredResultsPath, function (err, desired) {
+ if (err) return t.fail(err)
+
+ t.deepEqual(results, JSON.parse(desired))
+ s.close()
+ t.end()
+ })
+ })
+ })
+ })
+ })
+})
+
+test("cleanup", function (t) {
+ cleanup()
+ t.end()
+})
+
+
+function setup (opts, cb) {
+ cleanup()
+ process.chdir(pkg)
+
+ var allOpts = {
+ cache: path.resolve(pkg, "cache"),
+ registry: common.registry
+ }
+
+ for (var key in opts) {
+ allOpts[key] = opts[key]
+ }
+
+ npm.load(allOpts, cb)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(path.resolve(pkg, "node_modules"))
+ rimraf.sync(path.resolve(pkg, "cache"))
+ rimraf.sync(path.resolve(pkg, "npm-shrinkwrap.json"))
+}
--- /dev/null
+{
+ "name": "npm-test-shrinkwrap-dev-dependency",
+ "version": "0.0.0",
+ "dependencies": {
+ "request": {
+ "version": "0.9.0"
+ },
+ "underscore": {
+ "version": "1.3.1"
+ }
+ }
+}
--- /dev/null
+{
+ "author": "Domenic Denicola",
+ "name": "npm-test-shrinkwrap-dev-dependency",
+ "version": "0.0.0",
+ "dependencies": {
+ "request": "0.9.0",
+ "underscore": "1.3.1"
+ },
+ "devDependencies": {
+ "underscore": "1.5.1"
+ }
+}
--- /dev/null
+var npm = npm = require("../../")
+var test = require("tap").test
+var path = require("path")
+var fs = require("fs")
+var osenv = require("osenv")
+var rimraf = require("rimraf")
+var mr = require("npm-registry-mock")
+var common = require("../common-tap.js")
+
+var pkg = path.resolve(__dirname, "shrinkwrap-shared-dev-dependency")
+var desiredResultsPath = path.resolve(pkg, "desired-shrinkwrap-results.json")
+
+test("shrinkwrap doesn't strip out the shared dependency", function (t) {
+ t.plan(1)
+
+ mr(common.port, function (s) {
+ setup(function (err) {
+ if (err) return t.fail(err)
+
+ npm.install(".", function (err) {
+ if (err) return t.fail(err)
+
+ npm.commands.shrinkwrap([], true, function (err, results) {
+ if (err) return t.fail(err)
+
+ fs.readFile(desiredResultsPath, function (err, desired) {
+ if (err) return t.fail(err)
+
+ t.deepEqual(results, JSON.parse(desired))
+ s.close()
+ t.end()
+ })
+ })
+ })
+ })
+ })
+})
+
+test("cleanup", function (t) {
+ cleanup()
+ t.end()
+})
+
+
+function setup (cb) {
+ cleanup()
+ process.chdir(pkg)
+
+ var opts = { cache: path.resolve(pkg, "cache"), registry: common.registry }
+ npm.load(opts, cb)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(path.resolve(pkg, "node_modules"))
+ rimraf.sync(path.resolve(pkg, "cache"))
+ rimraf.sync(path.resolve(pkg, "npm-shrinkwrap.json"))
+}
--- /dev/null
+{
+ "name": "npm-test-shrinkwrap-shared-dev-dependency",
+ "version": "0.0.0",
+ "dependencies": {
+ "test-package-with-one-dep": {
+ "version": "0.0.0"
+ },
+ "test-package": {
+ "version": "0.0.0"
+ }
+ }
+}
--- /dev/null
+{
+ "author": "Domenic Denicola",
+ "name": "npm-test-shrinkwrap-shared-dev-dependency",
+ "version": "0.0.0",
+ "dependencies": {
+ "test-package-with-one-dep": "0.0.0"
+ },
+ "devDependencies": {
+ "test-package": "0.0.0"
+ }
+}