There's a pretty robust install script at
<https://www.npmjs.org/install.sh>. You can download that and run it.
+Here's an example using curl:
+
+ curl -L https://npmjs.org/install.sh | sh
+
### Slightly Fancier
You can set any npm configuration params with that script:
## SYNOPSIS
var npm = require("npm")
- npm.load([configObject], function (er, npm) {
+ npm.load([configObject, ]function (er, npm) {
// use the npm object, now that it's loaded.
npm.config.set(key, val)
* a) a folder containing a program described by a package.json file
* b) a gzipped tarball containing (a)
* c) a url that resolves to (b)
-* d) a `<name>@<version>` that is published on the registry with (c)
+* d) a `<name>@<version>` that is published on the registry (see `npm-registry(7)`) with (c)
* e) a `<name>@<tag>` that points to (d)
* f) a `<name>` that has a "latest" tag satisfying (e)
* g) a `<git remote url>` that resolves to (b)
* npm-config(7)
* npmrc(5)
* npm-registry(7)
-* npm-folders(5)
* npm-tag(1)
* npm-rm(1)
* npm-shrinkwrap(1)
## SYNOPSIS
- npm run-script <script> <name>
+ npm run-script [<pkg>] <command>
## DESCRIPTION
-This runs an arbitrary command from a package's "scripts" object.
+This runs an arbitrary command from a package's `"scripts"` object.
+If no package name is provided, it will search for a `package.json`
+in the current folder and use its `"scripts"` object.
It is used by the test, start, restart, and stop commands, but can be
called directly, as well.
* `<version`
* `<=version`
* `~version` "Approximately equivalent to version" See semver(7)
+* `^version` "Compatible with version" See semver(7)
* `1.2.x` 1.2.0, 1.2.1, etc., but not 1.3.0
* `http://...` See 'URLs as Dependencies' below
* `*` Matches any version
<title>README</title>
<meta http-equiv="content-type" value="text/html;utf-8">
<link rel="stylesheet" type="text/css" href="../static/style.css">
- <link rel="canonical" href="https://www.npmjs.org/doc/<a href="../doc/README.html">README</a>.html">
+ <link rel="canonical" href="https://www.npmjs.org/doc/README.html">
<script async=true src="../../static/toc.js"></script>
<body>
<p>There's a pretty robust install script at
<a href="https://www.npmjs.org/install.sh">https://www.npmjs.org/install.sh</a>. You can download that and run it.</p>
+<p>Here's an example using curl:</p>
+
+<pre><code>curl -L https://npmjs.org/install.sh | sh</code></pre>
+
<h3 id="Slightly-Fancier">Slightly Fancier</h3>
<p>You can set any npm configuration params with that script:</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer"><a href="../doc/README.html">README</a> — npm@1.4.7</p>
+<p id="footer"><a href="../doc/README.html">README</a> — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-bin — npm@1.4.7</p>
+<p id="footer">npm-bin — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-bugs — npm@1.4.7</p>
+<p id="footer">npm-bugs — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-commands — npm@1.4.7</p>
+<p id="footer">npm-commands — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-config — npm@1.4.7</p>
+<p id="footer">npm-config — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-deprecate — npm@1.4.7</p>
+<p id="footer">npm-deprecate — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-docs — npm@1.4.7</p>
+<p id="footer">npm-docs — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-edit — npm@1.4.7</p>
+<p id="footer">npm-edit — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-explore — npm@1.4.7</p>
+<p id="footer">npm-explore — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-help-search — npm@1.4.7</p>
+<p id="footer">npm-help-search — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-init — npm@1.4.7</p>
+<p id="footer">npm-init — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-install — npm@1.4.7</p>
+<p id="footer">npm-install — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-link — npm@1.4.7</p>
+<p id="footer">npm-link — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-load — npm@1.4.7</p>
+<p id="footer">npm-load — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-ls — npm@1.4.7</p>
+<p id="footer">npm-ls — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-outdated — npm@1.4.7</p>
+<p id="footer">npm-outdated — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-owner — npm@1.4.7</p>
+<p id="footer">npm-owner — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-pack — npm@1.4.7</p>
+<p id="footer">npm-pack — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-prefix — npm@1.4.7</p>
+<p id="footer">npm-prefix — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-prune — npm@1.4.7</p>
+<p id="footer">npm-prune — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-publish — npm@1.4.7</p>
+<p id="footer">npm-publish — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-rebuild — npm@1.4.7</p>
+<p id="footer">npm-rebuild — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-repo — npm@1.4.7</p>
+<p id="footer">npm-repo — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-restart — npm@1.4.7</p>
+<p id="footer">npm-restart — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-root — npm@1.4.7</p>
+<p id="footer">npm-root — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-run-script — npm@1.4.7</p>
+<p id="footer">npm-run-script — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-search — npm@1.4.7</p>
+<p id="footer">npm-search — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-shrinkwrap — npm@1.4.7</p>
+<p id="footer">npm-shrinkwrap — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-start — npm@1.4.7</p>
+<p id="footer">npm-start — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-stop — npm@1.4.7</p>
+<p id="footer">npm-stop — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-submodule — npm@1.4.7</p>
+<p id="footer">npm-submodule — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-tag — npm@1.4.7</p>
+<p id="footer">npm-tag — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-test — npm@1.4.7</p>
+<p id="footer">npm-test — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-uninstall — npm@1.4.7</p>
+<p id="footer">npm-uninstall — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-unpublish — npm@1.4.7</p>
+<p id="footer">npm-unpublish — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-update — npm@1.4.7</p>
+<p id="footer">npm-update — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-version — npm@1.4.7</p>
+<p id="footer">npm-version — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-view — npm@1.4.7</p>
+<p id="footer">npm-view — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-whoami — npm@1.4.7</p>
+<p id="footer">npm-whoami — npm@1.4.8</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<pre><code>var npm = require("npm")
-npm.load([configObject], function (er, npm) {
+npm.load([configObject, ]function (er, npm) {
// use the npm object, now that it's loaded.
npm.config.set(key, val)
<h2 id="VERSION">VERSION</h2>
-<p>1.4.7</p>
+<p>1.4.8</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm — npm@1.4.7</p>
+<p id="footer">npm — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-adduser — npm@1.4.7</p>
+<p id="footer">npm-adduser — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-bin — npm@1.4.7</p>
+<p id="footer">npm-bin — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-bugs — npm@1.4.7</p>
+<p id="footer">npm-bugs — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-build — npm@1.4.7</p>
+<p id="footer">npm-build — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-bundle — npm@1.4.7</p>
+<p id="footer">npm-bundle — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-cache — npm@1.4.7</p>
+<p id="footer">npm-cache — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-completion — npm@1.4.7</p>
+<p id="footer">npm-completion — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-config — npm@1.4.7</p>
+<p id="footer">npm-config — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-dedupe — npm@1.4.7</p>
+<p id="footer">npm-dedupe — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-deprecate — npm@1.4.7</p>
+<p id="footer">npm-deprecate — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-docs — npm@1.4.7</p>
+<p id="footer">npm-docs — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-edit — npm@1.4.7</p>
+<p id="footer">npm-edit — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-explore — npm@1.4.7</p>
+<p id="footer">npm-explore — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-help-search — npm@1.4.7</p>
+<p id="footer">npm-help-search — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-help — npm@1.4.7</p>
+<p id="footer">npm-help — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-init — npm@1.4.7</p>
+<p id="footer">npm-init — npm@1.4.8</p>
<p>A <code>package</code> is:</p>
-<ul><li>a) a folder containing a program described by a package.json file</li><li>b) a gzipped tarball containing (a)</li><li>c) a url that resolves to (b)</li><li>d) a <code><name>@<version></code> that is published on the registry with (c)</li><li>e) a <code><name>@<tag></code> that points to (d)</li><li>f) a <code><name></code> that has a "latest" tag satisfying (e)</li><li>g) a <code><git remote url></code> that resolves to (b)</li></ul>
+<ul><li>a) a folder containing a program described by a package.json file</li><li>b) a gzipped tarball containing (a)</li><li>c) a url that resolves to (b)</li><li>d) a <code><name>@<version></code> that is published on the registry (see <code><a href="../misc/npm-registry.html">npm-registry(7)</a></code>) with (c)</li><li>e) a <code><name>@<tag></code> that points to (d)</li><li>f) a <code><name></code> that has a "latest" tag satisfying (e)</li><li>g) a <code><git remote url></code> that resolves to (b)</li></ul>
<p>Even if you never publish your package, you can still get a lot of
benefits of using npm if you just want to write a node program (a), and
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<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>
+<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="../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>
<table border=0 cellspacing=0 cellpadding=0 id=npmlogo>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-install — npm@1.4.7</p>
+<p id="footer">npm-install — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-link — npm@1.4.7</p>
+<p id="footer">npm-link — npm@1.4.8</p>
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.7 /path/to/npm
+<pre><code>npm@1.4.8 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5</code></pre>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-ls — npm@1.4.7</p>
+<p id="footer">npm-ls — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-outdated — npm@1.4.7</p>
+<p id="footer">npm-outdated — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-owner — npm@1.4.7</p>
+<p id="footer">npm-owner — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-pack — npm@1.4.7</p>
+<p id="footer">npm-pack — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-prefix — npm@1.4.7</p>
+<p id="footer">npm-prefix — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-prune — npm@1.4.7</p>
+<p id="footer">npm-prune — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-publish — npm@1.4.7</p>
+<p id="footer">npm-publish — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-rebuild — npm@1.4.7</p>
+<p id="footer">npm-rebuild — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-repo — npm@1.4.7</p>
+<p id="footer">npm-repo — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-restart — npm@1.4.7</p>
+<p id="footer">npm-restart — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-rm — npm@1.4.7</p>
+<p id="footer">npm-rm — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-root — npm@1.4.7</p>
+<p id="footer">npm-root — npm@1.4.8</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
-<pre><code>npm run-script <script> <name></code></pre>
+<pre><code>npm run-script [<pkg>] <command></code></pre>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
-<p>This runs an arbitrary command from a package's "scripts" object.</p>
+<p>This runs an arbitrary command from a package's <code>"scripts"</code> object.
+If no package name is provided, it will search for a <code>package.json</code>
+in the current folder and use its <code>"scripts"</code> object.</p>
<p>It is used by the test, start, restart, and stop commands, but can be
called directly, as well.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-run-script — npm@1.4.7</p>
+<p id="footer">npm-run-script — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-search — npm@1.4.7</p>
+<p id="footer">npm-search — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-shrinkwrap — npm@1.4.7</p>
+<p id="footer">npm-shrinkwrap — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-star — npm@1.4.7</p>
+<p id="footer">npm-star — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-stars — npm@1.4.7</p>
+<p id="footer">npm-stars — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-start — npm@1.4.7</p>
+<p id="footer">npm-start — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-stop — npm@1.4.7</p>
+<p id="footer">npm-stop — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-submodule — npm@1.4.7</p>
+<p id="footer">npm-submodule — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-tag — npm@1.4.7</p>
+<p id="footer">npm-tag — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-test — npm@1.4.7</p>
+<p id="footer">npm-test — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-uninstall — npm@1.4.7</p>
+<p id="footer">npm-uninstall — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-unpublish — npm@1.4.7</p>
+<p id="footer">npm-unpublish — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-update — npm@1.4.7</p>
+<p id="footer">npm-update — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-version — npm@1.4.7</p>
+<p id="footer">npm-version — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-view — npm@1.4.7</p>
+<p id="footer">npm-view — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-whoami — npm@1.4.7</p>
+<p id="footer">npm-whoami — npm@1.4.8</p>
<h2 id="VERSION">VERSION</h2>
-<p>1.4.7</p>
+<p>1.4.8</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm — npm@1.4.7</p>
+<p id="footer">npm — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-folders — npm@1.4.7</p>
+<p id="footer">npm-folders — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-folders — npm@1.4.7</p>
+<p id="footer">npm-folders — npm@1.4.8</p>
<p>See <a href="../misc/semver.html">semver(7)</a> for more details about specifying version ranges.</p>
-<ul><li><code>version</code> Must match <code>version</code> exactly</li><li><code>>version</code> Must be greater than <code>version</code></li><li><code>>=version</code> etc</li><li><code><version</code></li><li><code><=version</code></li><li><code>~version</code> "Approximately equivalent to version" See <a href="../misc/semver.html">semver(7)</a></li><li><code>1.2.x</code> 1.2.0, 1.2.1, etc., but not 1.3.0</li><li><code>http://...</code> See 'URLs as Dependencies' below</li><li><code>*</code> Matches any version</li><li><code>""</code> (just an empty string) Same as <code>*</code></li><li><code>version1 - version2</code> Same as <code>>=version1 <=version2</code>.</li><li><code>range1 || range2</code> Passes if either range1 or range2 are satisfied.</li><li><code>git...</code> See 'Git URLs as Dependencies' below</li><li><code>user/repo</code> See 'GitHub URLs' below</li></ul>
+<ul><li><code>version</code> Must match <code>version</code> exactly</li><li><code>>version</code> Must be greater than <code>version</code></li><li><code>>=version</code> etc</li><li><code><version</code></li><li><code><=version</code></li><li><code>~version</code> "Approximately equivalent to version" See <a href="../misc/semver.html">semver(7)</a></li><li><code>^version</code> "Compatible with version" See <a href="../misc/semver.html">semver(7)</a></li><li><code>1.2.x</code> 1.2.0, 1.2.1, etc., but not 1.3.0</li><li><code>http://...</code> See 'URLs as Dependencies' below</li><li><code>*</code> Matches any version</li><li><code>""</code> (just an empty string) Same as <code>*</code></li><li><code>version1 - version2</code> Same as <code>>=version1 <=version2</code>.</li><li><code>range1 || range2</code> Passes if either range1 or range2 are satisfied.</li><li><code>git...</code> See 'Git URLs as Dependencies' below</li><li><code>user/repo</code> See 'GitHub URLs' below</li></ul>
<p>For example, these are all valid:</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">package.json — npm@1.4.7</p>
+<p id="footer">package.json — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npmrc — npm@1.4.7</p>
+<p id="footer">npmrc — npm@1.4.8</p>
<p>See <a href="../misc/semver.html">semver(7)</a> for more details about specifying version ranges.</p>
-<ul><li><code>version</code> Must match <code>version</code> exactly</li><li><code>>version</code> Must be greater than <code>version</code></li><li><code>>=version</code> etc</li><li><code><version</code></li><li><code><=version</code></li><li><code>~version</code> "Approximately equivalent to version" See <a href="../misc/semver.html">semver(7)</a></li><li><code>1.2.x</code> 1.2.0, 1.2.1, etc., but not 1.3.0</li><li><code>http://...</code> See 'URLs as Dependencies' below</li><li><code>*</code> Matches any version</li><li><code>""</code> (just an empty string) Same as <code>*</code></li><li><code>version1 - version2</code> Same as <code>>=version1 <=version2</code>.</li><li><code>range1 || range2</code> Passes if either range1 or range2 are satisfied.</li><li><code>git...</code> See 'Git URLs as Dependencies' below</li><li><code>user/repo</code> See 'GitHub URLs' below</li></ul>
+<ul><li><code>version</code> Must match <code>version</code> exactly</li><li><code>>version</code> Must be greater than <code>version</code></li><li><code>>=version</code> etc</li><li><code><version</code></li><li><code><=version</code></li><li><code>~version</code> "Approximately equivalent to version" See <a href="../misc/semver.html">semver(7)</a></li><li><code>^version</code> "Compatible with version" See <a href="../misc/semver.html">semver(7)</a></li><li><code>1.2.x</code> 1.2.0, 1.2.1, etc., but not 1.3.0</li><li><code>http://...</code> See 'URLs as Dependencies' below</li><li><code>*</code> Matches any version</li><li><code>""</code> (just an empty string) Same as <code>*</code></li><li><code>version1 - version2</code> Same as <code>>=version1 <=version2</code>.</li><li><code>range1 || range2</code> Passes if either range1 or range2 are satisfied.</li><li><code>git...</code> See 'Git URLs as Dependencies' below</li><li><code>user/repo</code> See 'GitHub URLs' below</li></ul>
<p>For example, these are all valid:</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">package.json — npm@1.4.7</p>
+<p id="footer">package.json — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-index — npm@1.4.7</p>
+<p id="footer">npm-index — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-coding-style — npm@1.4.7</p>
+<p id="footer">npm-coding-style — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-config — npm@1.4.7</p>
+<p id="footer">npm-config — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-developers — npm@1.4.7</p>
+<p id="footer">npm-developers — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-disputes — npm@1.4.7</p>
+<p id="footer">npm-disputes — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-faq — npm@1.4.7</p>
+<p id="footer">npm-faq — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-index — npm@1.4.7</p>
+<p id="footer">npm-index — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-registry — npm@1.4.7</p>
+<p id="footer">npm-registry — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-scripts — npm@1.4.7</p>
+<p id="footer">npm-scripts — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">removing-npm — npm@1.4.7</p>
+<p id="footer">removing-npm — npm@1.4.8</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">semver — npm@1.4.7</p>
+<p id="footer">semver — npm@1.4.8</p>
function readPassword (c, u, cb) {
var v = userValidate.pw
- if (!c.changed) {
- u.p = c.p
- return cb()
+ var prompt
+ if (c.p && !c.changed) {
+ prompt = "Password: (or leave unchanged) "
+ } else {
+ prompt = "Password: "
}
- read({prompt: "Password: ", silent: true}, function (er, pw) {
+
+ read({prompt: prompt, silent: true}, function (er, pw) {
if (er) {
return cb(er.message === "cancelled" ? er.message : er)
}
+ if (!c.changed && pw === "") {
+ // when the username was not changed,
+ // empty response means "use the old value"
+ pw = c.p
+ }
+
if (!pw) {
return readPassword(c, u, cb)
}
return readPassword(c, u, cb)
}
+ c.changed = c.changed || c.p != pw
u.p = pw
cb(er)
})
, which = require("which")
, isGitUrl = require("./utils/is-git-url.js")
, pathIsInside = require("path-is-inside")
+ , http = require("http")
cache.usage = "npm cache add <tarball file>"
+ "\nnpm cache add <folder>"
}
registry.get(name, function (er, data, json, response) {
+ if (!er) {
+ er = errorResponse(name, resp)
+ }
if (er) return cb(er)
engineFilter(data)
if (data["dist-tags"] && data["dist-tags"][tag]
})
}
+function errorResponse (name, response) {
+ if (response.statusCode >= 400) {
+ var er = new Error(http.STATUS_CODES[response.statusCode])
+ er.statusCode = response.statusCode
+ er.code = "E" + er.statusCode
+ er.pkgid = name
+ }
+ return er
+}
+
function addNameRange (name, range, data, cb) {
if (typeof cb !== "function") cb = data, data = null
if (data) return next()
registry.get(name, function (er, d, json, response) {
+ if (!er) {
+ er = errorResponse(name, response)
+ }
if (er) return cb(er)
data = d
next()
return next()
}
registry.get(name, function (er, d, json, resp) {
+ if (!er) {
+ er = errorResponse(name, resp)
+ }
if (er) return cb(er)
data = d && d.versions[ver]
if (!data) {
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR")
return cb(er)
if (er) return fetchit()
+ // check the SHA of the package we have, to ensure it wasn't installed
+ // from somewhere other than the registry (eg, a fork)
+ if (data._shasum && dist.shasum && data._shasum !== dist.shasum)
+ return fetchit()
return cb(null, data)
})
} else return fetchit()
var section = npm.deref(args[0]) || args[0]
// npm help <noargs>: show basic usage
- if (!section)
- return npmUsage(cb)
+ if (!section) {
+ var valid = argv[0] === 'help' ? 0 : 1
+ return npmUsage(valid, cb)
+ }
+
// npm <cmd> -h: show command usage
if ( npm.config.get("usage")
return path.resolve(__dirname, "..", "html", "doc", sect, f)
}
-function npmUsage (cb) {
+function npmUsage (valid, cb) {
npm.config.set("loglevel", "silent")
log.level = "silent"
console.log
, ""
, "npm@" + npm.version + " " + path.dirname(__dirname)
].join("\n"))
- cb()
+ cb(valid)
}
function usages () {
if (g) g = " (" + g + ")"
return c.what + g
})
- })
+ }, "", { unicode: npm.config.get("unicode") })
}).join("\n")
}
npmconf.load(cli, builtin, function (er, config) {
if (er === config) er = null
+ // Include npm-version and node-version in user-agent
+ var ua = config.get("user-agent") || ""
+ ua = ua.replace(/\{node-version\}/gi, process.version)
+ ua = ua.replace(/\{npm-version\}/gi, npm.version)
+ ua = ua.replace(/\{platform\}/gi, process.platform)
+ ua = ua.replace(/\{arch\}/gi, process.arch)
+ config.set("user-agent", ua)
+
npm.config = config
var color = config.get("color")
var os = require("os")
// just a line break
- console.error("")
+ if (log.levels[log.level] <= log.levels.error) console.error("")
log.error("System", os.type() + " " + os.release())
log.error("command", process.argv
.map(JSON.stringify).join(" "))
exports = module.exports = lifecycle
exports.cmd = cmd
+exports.makeEnv = makeEnv
var log = require("npmlog")
, spawn = require("child_process").spawn
var value = npm.config.get(i)
if (value instanceof Stream || Array.isArray(value)) return
if (!value) value = ""
+ else if (typeof value === "number") value = "" + value
else if (typeof value !== "string") value = JSON.stringify(value)
value = -1 !== value.indexOf("\n")
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM" "1" "April 2014" "" ""
+.TH "NPM" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm\fR \-\- node package manager![Build Status \fIhttps://img\.shields\.io/travis/npm/npm/master\.svg)](https://travis\-ci\.org/npm/npm\fR
.SH "Fancy Install (Unix)"
There\'s a pretty robust install script at \fIhttps://www\.npmjs\.org/install\.sh\fR\|\. You can download that and run it\.
.
+.P
+Here\'s an example using curl:
+.
+.IP "" 4
+.
+.nf
+curl \-L https://npmjs\.org/install\.sh | sh
+.
+.fi
+.
+.IP "" 0
+.
.SS "Slightly Fancier"
You can set any npm configuration params with that script:
.
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-ADDUSER" "1" "April 2014" "" ""
+.TH "NPM\-ADDUSER" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-adduser\fR \-\- Add a registry user account
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-BIN" "1" "April 2014" "" ""
+.TH "NPM\-BIN" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-bin\fR \-\- Display npm bin folder
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-BUGS" "1" "April 2014" "" ""
+.TH "NPM\-BUGS" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-bugs\fR \-\- Bugs for a package in a web browser maybe
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-BUILD" "1" "April 2014" "" ""
+.TH "NPM\-BUILD" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-build\fR \-\- Build a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-BUNDLE" "1" "April 2014" "" ""
+.TH "NPM\-BUNDLE" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-bundle\fR \-\- REMOVED
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-CACHE" "1" "April 2014" "" ""
+.TH "NPM\-CACHE" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-cache\fR \-\- Manipulates packages cache
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-COMPLETION" "1" "April 2014" "" ""
+.TH "NPM\-COMPLETION" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-completion\fR \-\- Tab Completion for npm
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-CONFIG" "1" "April 2014" "" ""
+.TH "NPM\-CONFIG" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-config\fR \-\- Manage the npm configuration files
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-DEDUPE" "1" "April 2014" "" ""
+.TH "NPM\-DEDUPE" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-dedupe\fR \-\- Reduce duplication
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-DEPRECATE" "1" "April 2014" "" ""
+.TH "NPM\-DEPRECATE" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-deprecate\fR \-\- Deprecate a version of a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-DOCS" "1" "April 2014" "" ""
+.TH "NPM\-DOCS" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-docs\fR \-\- Docs for a package in a web browser maybe
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-EDIT" "1" "April 2014" "" ""
+.TH "NPM\-EDIT" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-edit\fR \-\- Edit an installed package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-EXPLORE" "1" "April 2014" "" ""
+.TH "NPM\-EXPLORE" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-explore\fR \-\- Browse an installed package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-HELP\-SEARCH" "1" "April 2014" "" ""
+.TH "NPM\-HELP\-SEARCH" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-help-search\fR \-\- Search npm help documentation
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-HELP" "1" "April 2014" "" ""
+.TH "NPM\-HELP" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-help\fR \-\- Get help on npm
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-INIT" "1" "April 2014" "" ""
+.TH "NPM\-INIT" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-init\fR \-\- Interactively create a package\.json file
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-INSTALL" "1" "April 2014" "" ""
+.TH "NPM\-INSTALL" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-install\fR \-\- Install a package
c) a url that resolves to (b)
.
.IP "\(bu" 4
-d) a \fB<name>@<version>\fR that is published on the registry with (c)
+d) a \fB<name>@<version>\fR that is published on the registry (npm help see \fBnpm\-registry\fR) with (c)
.
.IP "\(bu" 4
e) a \fB<name>@<tag>\fR that points to (d)
npm help registry
.
.IP "\(bu" 4
-npm help folders
-.
-.IP "\(bu" 4
npm help tag
.
.IP "\(bu" 4
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-LINK" "1" "April 2014" "" ""
+.TH "NPM\-LINK" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-link\fR \-\- Symlink a package folder
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-LS" "1" "April 2014" "" ""
+.TH "NPM\-LS" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-ls\fR \-\- List installed packages
.IP "" 4
.
.nf
-npm@1.4.7 /path/to/npm
+npm@1.4.8 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-OUTDATED" "1" "April 2014" "" ""
+.TH "NPM\-OUTDATED" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-outdated\fR \-\- Check for outdated packages
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-OWNER" "1" "April 2014" "" ""
+.TH "NPM\-OWNER" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-owner\fR \-\- Manage package owners
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PACK" "1" "April 2014" "" ""
+.TH "NPM\-PACK" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-pack\fR \-\- Create a tarball from a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PREFIX" "1" "April 2014" "" ""
+.TH "NPM\-PREFIX" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-prefix\fR \-\- Display prefix
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PRUNE" "1" "April 2014" "" ""
+.TH "NPM\-PRUNE" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-prune\fR \-\- Remove extraneous packages
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PUBLISH" "1" "April 2014" "" ""
+.TH "NPM\-PUBLISH" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-publish\fR \-\- Publish a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-REBUILD" "1" "April 2014" "" ""
+.TH "NPM\-REBUILD" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-rebuild\fR \-\- Rebuild a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-REPO" "1" "April 2014" "" ""
+.TH "NPM\-REPO" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-repo\fR \-\- Open package repository page in the browser
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-RESTART" "1" "April 2014" "" ""
+.TH "NPM\-RESTART" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-restart\fR \-\- Start a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-RM" "1" "April 2014" "" ""
+.TH "NPM\-RM" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-rm\fR \-\- Remove a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-ROOT" "1" "April 2014" "" ""
+.TH "NPM\-ROOT" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-root\fR \-\- Display npm root
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-RUN\-SCRIPT" "1" "April 2014" "" ""
+.TH "NPM\-RUN\-SCRIPT" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-run-script\fR \-\- Run arbitrary package scripts
.SH "SYNOPSIS"
.
.nf
-npm run\-script <script> <name>
+npm run\-script [<pkg>] <command>
.
.fi
.
.SH "DESCRIPTION"
-This runs an arbitrary command from a package\'s "scripts" object\.
+This runs an arbitrary command from a package\'s \fB"scripts"\fR object\.
+If no package name is provided, it will search for a \fBpackage\.json\fR
+in the current folder and use its \fB"scripts"\fR object\.
.
.P
It is used by the test, start, restart, and stop commands, but can be
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SEARCH" "1" "April 2014" "" ""
+.TH "NPM\-SEARCH" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-search\fR \-\- Search for packages
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SHRINKWRAP" "1" "April 2014" "" ""
+.TH "NPM\-SHRINKWRAP" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-shrinkwrap\fR \-\- Lock down dependency versions
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-STAR" "1" "April 2014" "" ""
+.TH "NPM\-STAR" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-star\fR \-\- Mark your favorite packages
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-STARS" "1" "April 2014" "" ""
+.TH "NPM\-STARS" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-stars\fR \-\- View packages marked as favorites
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-START" "1" "April 2014" "" ""
+.TH "NPM\-START" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-start\fR \-\- Start a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-STOP" "1" "April 2014" "" ""
+.TH "NPM\-STOP" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-stop\fR \-\- Stop a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SUBMODULE" "1" "April 2014" "" ""
+.TH "NPM\-SUBMODULE" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-submodule\fR \-\- Add a package as a git submodule
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-TAG" "1" "April 2014" "" ""
+.TH "NPM\-TAG" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-tag\fR \-\- Tag a published version
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-TEST" "1" "April 2014" "" ""
+.TH "NPM\-TEST" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-test\fR \-\- Test a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-RM" "1" "April 2014" "" ""
+.TH "NPM\-RM" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-rm\fR \-\- Remove a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-UNPUBLISH" "1" "April 2014" "" ""
+.TH "NPM\-UNPUBLISH" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-unpublish\fR \-\- Remove a package from the registry
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-UPDATE" "1" "April 2014" "" ""
+.TH "NPM\-UPDATE" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-update\fR \-\- Update a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-VERSION" "1" "April 2014" "" ""
+.TH "NPM\-VERSION" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-version\fR \-\- Bump a package version
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-VIEW" "1" "April 2014" "" ""
+.TH "NPM\-VIEW" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-view\fR \-\- View registry info
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-WHOAMI" "1" "April 2014" "" ""
+.TH "NPM\-WHOAMI" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-whoami\fR \-\- Display npm username
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM" "1" "April 2014" "" ""
+.TH "NPM" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm\fR \-\- node package manager
.fi
.
.SH "VERSION"
-1.4.7
+1.4.8
.
.SH "DESCRIPTION"
npm is the package manager for the Node JavaScript platform\. It puts
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-BIN" "3" "April 2014" "" ""
+.TH "NPM\-BIN" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-bin\fR \-\- Display npm bin folder
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-BUGS" "3" "April 2014" "" ""
+.TH "NPM\-BUGS" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-bugs\fR \-\- Bugs for a package in a web browser maybe
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-COMMANDS" "3" "April 2014" "" ""
+.TH "NPM\-COMMANDS" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-commands\fR \-\- npm commands
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-CONFIG" "3" "April 2014" "" ""
+.TH "NPM\-CONFIG" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-config\fR \-\- Manage the npm configuration files
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-DEPRECATE" "3" "April 2014" "" ""
+.TH "NPM\-DEPRECATE" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-deprecate\fR \-\- Deprecate a version of a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-DOCS" "3" "April 2014" "" ""
+.TH "NPM\-DOCS" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-docs\fR \-\- Docs for a package in a web browser maybe
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-EDIT" "3" "April 2014" "" ""
+.TH "NPM\-EDIT" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-edit\fR \-\- Edit an installed package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-EXPLORE" "3" "April 2014" "" ""
+.TH "NPM\-EXPLORE" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-explore\fR \-\- Browse an installed package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-HELP\-SEARCH" "3" "April 2014" "" ""
+.TH "NPM\-HELP\-SEARCH" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-help-search\fR \-\- Search the help pages
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "INIT" "3" "April 2014" "" ""
+.TH "INIT" "3" "May 2014" "" ""
.
.SH "NAME"
\fBinit\fR \-\- Interactively create a package\.json file
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-INSTALL" "3" "April 2014" "" ""
+.TH "NPM\-INSTALL" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-install\fR \-\- install a package programmatically
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-LINK" "3" "April 2014" "" ""
+.TH "NPM\-LINK" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-link\fR \-\- Symlink a package folder
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-LOAD" "3" "April 2014" "" ""
+.TH "NPM\-LOAD" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-load\fR \-\- Load config settings
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-LS" "3" "April 2014" "" ""
+.TH "NPM\-LS" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-ls\fR \-\- List installed packages
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-OUTDATED" "3" "April 2014" "" ""
+.TH "NPM\-OUTDATED" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-outdated\fR \-\- Check for outdated packages
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-OWNER" "3" "April 2014" "" ""
+.TH "NPM\-OWNER" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-owner\fR \-\- Manage package owners
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PACK" "3" "April 2014" "" ""
+.TH "NPM\-PACK" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-pack\fR \-\- Create a tarball from a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PREFIX" "3" "April 2014" "" ""
+.TH "NPM\-PREFIX" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-prefix\fR \-\- Display prefix
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PRUNE" "3" "April 2014" "" ""
+.TH "NPM\-PRUNE" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-prune\fR \-\- Remove extraneous packages
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PUBLISH" "3" "April 2014" "" ""
+.TH "NPM\-PUBLISH" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-publish\fR \-\- Publish a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-REBUILD" "3" "April 2014" "" ""
+.TH "NPM\-REBUILD" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-rebuild\fR \-\- Rebuild a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-REPO" "3" "April 2014" "" ""
+.TH "NPM\-REPO" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-repo\fR \-\- Open package repository page in the browser
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-RESTART" "3" "April 2014" "" ""
+.TH "NPM\-RESTART" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-restart\fR \-\- Start a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-ROOT" "3" "April 2014" "" ""
+.TH "NPM\-ROOT" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-root\fR \-\- Display npm root
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-RUN\-SCRIPT" "3" "April 2014" "" ""
+.TH "NPM\-RUN\-SCRIPT" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-run-script\fR \-\- Run arbitrary package scripts
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SEARCH" "3" "April 2014" "" ""
+.TH "NPM\-SEARCH" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-search\fR \-\- Search for packages
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SHRINKWRAP" "3" "April 2014" "" ""
+.TH "NPM\-SHRINKWRAP" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-shrinkwrap\fR \-\- programmatically generate package shrinkwrap file
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-START" "3" "April 2014" "" ""
+.TH "NPM\-START" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-start\fR \-\- Start a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-STOP" "3" "April 2014" "" ""
+.TH "NPM\-STOP" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-stop\fR \-\- Stop a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SUBMODULE" "3" "April 2014" "" ""
+.TH "NPM\-SUBMODULE" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-submodule\fR \-\- Add a package as a git submodule
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-TAG" "3" "April 2014" "" ""
+.TH "NPM\-TAG" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-tag\fR \-\- Tag a published version
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-TEST" "3" "April 2014" "" ""
+.TH "NPM\-TEST" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-test\fR \-\- Test a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-UNINSTALL" "3" "April 2014" "" ""
+.TH "NPM\-UNINSTALL" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-uninstall\fR \-\- uninstall a package programmatically
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-UNPUBLISH" "3" "April 2014" "" ""
+.TH "NPM\-UNPUBLISH" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-unpublish\fR \-\- Remove a package from the registry
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-UPDATE" "3" "April 2014" "" ""
+.TH "NPM\-UPDATE" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-update\fR \-\- Update a package
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-VERSION" "3" "April 2014" "" ""
+.TH "NPM\-VERSION" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-version\fR \-\- Bump a package version
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-VIEW" "3" "April 2014" "" ""
+.TH "NPM\-VIEW" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-view\fR \-\- View registry info
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-WHOAMI" "3" "April 2014" "" ""
+.TH "NPM\-WHOAMI" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-whoami\fR \-\- Display npm username
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM" "3" "April 2014" "" ""
+.TH "NPM" "3" "May 2014" "" ""
.
.SH "NAME"
\fBnpm\fR \-\- node package manager
.
.nf
var npm = require("npm")
-npm\.load([configObject], function (er, npm) {
+npm\.load([configObject, ]function (er, npm) {
// use the npm object, now that it\'s loaded\.
npm\.config\.set(key, val)
val = npm\.config\.get(key)
.fi
.
.SH "VERSION"
-1.4.7
+1.4.8
.
.SH "DESCRIPTION"
This is the API documentation for npm\.
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-FOLDERS" "5" "April 2014" "" ""
+.TH "NPM\-FOLDERS" "5" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-folders\fR \-\- Folder Structures Used by npm
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-FOLDERS" "5" "April 2014" "" ""
+.TH "NPM\-FOLDERS" "5" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-folders\fR \-\- Folder Structures Used by npm
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "PACKAGE\.JSON" "5" "April 2014" "" ""
+.TH "PACKAGE\.JSON" "5" "May 2014" "" ""
.
.SH "NAME"
\fBpackage.json\fR \-\- Specifics of npm\'s package\.json handling
npm help \fB~version\fR "Approximately equivalent to version" See semver
.
.IP "\(bu" 4
+npm help \fB^version\fR "Compatible with version" See semver
+.
+.IP "\(bu" 4
\fB1\.2\.x\fR 1\.2\.0, 1\.2\.1, etc\., but not 1\.3\.0
.
.IP "\(bu" 4
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPMRC" "5" "April 2014" "" ""
+.TH "NPMRC" "5" "May 2014" "" ""
.
.SH "NAME"
\fBnpmrc\fR \-\- The npm config files
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "PACKAGE\.JSON" "5" "April 2014" "" ""
+.TH "PACKAGE\.JSON" "5" "May 2014" "" ""
.
.SH "NAME"
\fBpackage.json\fR \-\- Specifics of npm\'s package\.json handling
npm help \fB~version\fR "Approximately equivalent to version" See semver
.
.IP "\(bu" 4
+npm help \fB^version\fR "Compatible with version" See semver
+.
+.IP "\(bu" 4
\fB1\.2\.x\fR 1\.2\.0, 1\.2\.1, etc\., but not 1\.3\.0
.
.IP "\(bu" 4
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-CODING\-STYLE" "7" "April 2014" "" ""
+.TH "NPM\-CODING\-STYLE" "7" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-coding-style\fR \-\- npm\'s "funny" coding style
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-CONFIG" "7" "April 2014" "" ""
+.TH "NPM\-CONFIG" "7" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-config\fR \-\- More than you probably want to know about npm configuration
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-DEVELOPERS" "7" "April 2014" "" ""
+.TH "NPM\-DEVELOPERS" "7" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-developers\fR \-\- Developer Guide
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-DISPUTES" "7" "April 2014" "" ""
+.TH "NPM\-DISPUTES" "7" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-disputes\fR \-\- Handling Module Name Disputes
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-FAQ" "7" "April 2014" "" ""
+.TH "NPM\-FAQ" "7" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-faq\fR \-\- Frequently Asked Questions
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-INDEX" "7" "April 2014" "" ""
+.TH "NPM\-INDEX" "7" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-index\fR \-\- Index of all npm documentation
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-REGISTRY" "7" "April 2014" "" ""
+.TH "NPM\-REGISTRY" "7" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-registry\fR \-\- The JavaScript Package Registry
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SCRIPTS" "7" "April 2014" "" ""
+.TH "NPM\-SCRIPTS" "7" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-scripts\fR \-\- How npm handles the "scripts" field
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-REMOVAL" "1" "April 2014" "" ""
+.TH "NPM\-REMOVAL" "1" "May 2014" "" ""
.
.SH "NAME"
\fBnpm-removal\fR \-\- Cleaning the Slate
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
-.TH "SEMVER" "7" "April 2014" "" ""
+.TH "SEMVER" "7" "May 2014" "" ""
.
.SH "NAME"
\fBsemver\fR \-\- The semantic versioner for npm
module.exports = getUrl
function getUrl (r) {
- if (!r) return
- if (/^[\w-]+\/[\w-]+$/.test(r))
+ if (!r) return null
+ if (/^[\w-]+\/[\w\.-]+$/.test(r))
return "git://github.com/" + r
else
return null
-}
\ No newline at end of file
+}
{
"name": "github-url-from-username-repo",
- "version": "0.0.2",
+ "version": "0.1.0",
"description": "Create urls from username/repo",
"main": "index.js",
"scripts": {
],
"readme": "[![Build Status](https://travis-ci.org/robertkowalski/github-url-from-username-repo.png?branch=master)](https://travis-ci.org/robertkowalski/github-url-from-username-repo)\n[![Dependency Status](https://gemnasium.com/robertkowalski/github-url-from-username-repo.png)](https://gemnasium.com/robertkowalski/github-url-from-username-repo)\n\n\n# github-url-from-username-repo\n\n## Usage\n\n```javascript\n\nvar getUrl = require(\"github-url-from-username-repo\")\ngetUrl(\"visionmedia/express\") // git://github.com/visionmedia/express\n\n```",
"readmeFilename": "README.md",
- "_id": "github-url-from-username-repo@0.0.2",
- "_from": "github-url-from-username-repo@"
+ "homepage": "https://github.com/robertkowalski/github-url-from-username-repo",
+ "_id": "github-url-from-username-repo@0.1.0",
+ "dist": {
+ "shasum": "fe398af670692e91af7bcfc5ae1d99ff97b1df89"
+ },
+ "_from": "github-url-from-username-repo@0.1.0",
+ "_resolved": "https://registry.npmjs.org/github-url-from-username-repo/-/github-url-from-username-repo-0.1.0.tgz"
}
var url = getUrl("visionmedia/express")
assert.equal("git://github.com/visionmedia/express", url)
})
- it("works with -", function () {
- var url = getUrl("vision-media/express-package")
- assert.equal("git://github.com/vision-media/express-package", url)
- })
+
it("returns null if it does not match", function () {
var url = getUrl("package")
assert.deepEqual(null, url)
})
- it("returns undefined if no repo/user was given", function () {
+
+ it("returns null if no repo/user was given", function () {
var url = getUrl()
- assert.deepEqual(undefined, url)
+ assert.deepEqual(null, url)
+ })
+
+ it("works with .", function () {
+ var url = getUrl("component/downloader.js")
+ assert.equal("git://github.com/component/downloader.js", url)
+ })
+
+ it("works with . in the beginning", function () {
+ var url = getUrl("component/.downloader.js")
+ assert.equal("git://github.com/component/.downloader.js", url)
+ })
+
+ it("works with -", function () {
+ var url = getUrl("component/-dow-nloader.j-s")
+ assert.equal("git://github.com/component/-dow-nloader.j-s", url)
})
-})
\ No newline at end of file
+})
try { p = JSON.parse(p) }
catch (e) { return next() }
if (!p.version) return next()
- deps[d] = '^' + p.version
+ deps[d] = config.get('save-prefix') + p.version
return next()
})
})
exports.license = prompt('license', package.license ||
config.get('init.license') ||
- 'BSD-2-Clause')
+ 'ISC')
},
"homepage": "https://github.com/isaacs/promzard",
"_id": "promzard@0.2.1",
- "dist": {
- "shasum": "c4c7cbe5182465c13b43540be9daf47098b4e75b"
- },
+ "_shasum": "c4c7cbe5182465c13b43540be9daf47098b4e75b",
"_from": "promzard@~0.2.0",
"_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.2.1.tgz"
}
{
"name": "init-package-json",
- "version": "0.0.15",
+ "version": "0.0.16",
"main": "init-package-json.js",
"scripts": {
"test": "tap test/*.js"
"url": "https://github.com/isaacs/init-package-json/issues"
},
"homepage": "https://github.com/isaacs/init-package-json",
- "_id": "init-package-json@0.0.15",
- "dist": {
- "shasum": "d40f0201e4de6aa2b3fdc4208ae162766703ebed"
- },
- "_from": "init-package-json@latest",
- "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-0.0.15.tgz"
+ "_id": "init-package-json@0.0.16",
+ "_shasum": "f7bb96fcb0a2c8061d15a2c3180323b17a65aa16",
+ "_from": "init-package-json@latest"
}
function validatePath (data, k, val) {
if (val === true) return false
+ val = String(val)
+ var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\//
+ if (val.match(homePattern) && process.env.HOME) {
+ val = path.resolve(process.env.HOME, val.substr(2))
+ }
data[k] = path.resolve(String(val))
return true
}
{
"name": "nopt",
- "version": "2.2.0",
+ "version": "2.2.1",
"description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.",
"author": {
"name": "Isaac Z. Schlueter",
"url": "https://github.com/isaacs/nopt/issues"
},
"homepage": "https://github.com/isaacs/nopt",
- "_id": "nopt@2.2.0",
+ "_id": "nopt@2.2.1",
+ "_shasum": "2aa09b7d1768487b3b89a9c5aa52335bff0baea7",
"_from": "nopt@latest"
}
t.end()
})
+test("~ path is resolved to $HOME", function (t) {
+ var path = require("path")
+ if (!process.env.HOME) process.env.HOME = "/tmp"
+ var parsed = nopt({key: path}, {}, ["--key=~/val"], 0)
+ t.same(parsed.key, path.resolve(process.env.HOME, "val"))
+ t.end()
+})
+
test("other tests", function (t) {
var util = require("util")
, proxy : process.env.HTTP_PROXY || process.env.http_proxy || null
, "https-proxy" : process.env.HTTPS_PROXY || process.env.https_proxy ||
process.env.HTTP_PROXY || process.env.http_proxy || null
- , "user-agent" : "node/" + process.version
- + ' ' + process.platform
- + ' ' + process.arch
+ , "user-agent" : "npm/{npm-version} "
+ + "node/{node-version} "
+ + "{platform} "
+ + "{arch}"
, "rebuild-bundle" : true
, registry : "https://registry.npmjs.org/"
, rollback : true
{
"name": "npmconf",
- "version": "0.1.14",
+ "version": "0.1.15",
"description": "The config thing npm uses",
"main": "npmconf.js",
"directories": {
"url": "https://github.com/isaacs/npmconf/issues"
},
"homepage": "https://github.com/isaacs/npmconf",
- "_id": "npmconf@0.1.14",
- "_shasum": "aea4bc12c5a84191a32cd350e325da4fe8b127e7",
+ "_id": "npmconf@0.1.15",
+ "_shasum": "9df0f0545d04d121330c32a5be9d351b4a8df029",
"_from": "npmconf@latest"
}
language: node_js
node_js:
- "0.10"
- - "0.8"
\ No newline at end of file
var typos = require("./typos")
var coreModuleNames = require("./core_module_names")
var githubUserRepo = require("github-url-from-username-repo")
-var warningMessages = require('./warning_messages.json')
-var format = require('util').format
var fixer = module.exports = {
// default warning function
fixRepositoryField: function(data) {
if (data.repositories) {
- this.warn(warningMessages.repositories);
+ this.warn("repositories");
data.repository = data.repositories[0]
}
- if (!data.repository) return this.warn(warningMessages.missingRepository)
+ if (!data.repository) return this.warn("missingRepository")
if (typeof data.repository === "string") {
data.repository = {
type: "git",
}
if (r.match(/github.com\/[^\/]+\/[^\/]+\.git\.git$/)) {
- this.warn(format(warningMessages.brokenGitUrl, r))
+ this.warn("brokenGitUrl", r)
}
}
, fixTypos: function(data) {
Object.keys(typos.topLevel).forEach(function (d) {
if (data.hasOwnProperty(d)) {
- this.warn(makeTypoWarning(d, typos.topLevel[d]))
+ this.warn("typo", d, typos.topLevel[d])
}
}, this)
}
, fixScriptsField: function(data) {
if (!data.scripts) return
if (typeof data.scripts !== "object") {
- this.warn(warningMessages.nonObjectScripts)
+ this.warn("nonObjectScripts")
delete data.scripts
}
Object.keys(data.scripts).forEach(function (k) {
if (typeof data.scripts[k] !== "string") {
- this.warn(warningMessages.nonStringScript)
+ this.warn("nonStringScript")
delete data.scripts[k]
} else if (typos.script[k]) {
- this.warn(makeTypoWarning(k, typos.script[k], "scripts"))
+ this.warn("typo", k, typos.script[k], "scripts")
}
}, this)
}
, fixFilesField: function(data) {
var files = data.files
if (files && !Array.isArray(files)) {
- this.warn(warningMessages.nonArrayFiles)
+ this.warn("nonArrayFiles")
delete data.files
} else if (data.files) {
data.files = data.files.filter(function(file) {
if (!file || typeof file !== "string") {
- this.warn(format(warningMessages.invalidFilename, file))
+ this.warn("invalidFilename", file)
return false
} else {
return true
delete data[bdd]
}
if (data[bd] && !Array.isArray(data[bd])) {
- this.warn(warningMessages.nonArrayBundleDependencies)
+ this.warn("nonArrayBundleDependencies")
delete data[bd]
} else if (data[bd]) {
data[bd] = data[bd].filter(function(bd) {
if (!bd || typeof bd !== 'string') {
- this.warn(format(warningMessages.nonStringBundleDependency, bd))
+ this.warn("nonStringBundleDependency", bd)
return false
} else {
return true
;['dependencies','devDependencies'].forEach(function(deps) {
if (!(deps in data)) return
if (!data[deps] || typeof data[deps] !== "object") {
- this.warn(format(warningMessages.nonObjectDependencies, deps))
+ this.warn("nonObjectDependencies", deps)
delete data[deps]
return
}
Object.keys(data[deps]).forEach(function (d) {
var r = data[deps][d]
if (typeof r !== 'string') {
- this.warn(format(warningMessages.nonStringDependency, d, JSON.stringify(r)))
+ this.warn("nonStringDependency", d, JSON.stringify(r))
delete data[deps][d]
}
// "/" is not allowed as packagename for publishing, but for git-urls
, fixModulesField: function (data) {
if (data.modules) {
- this.warn(warningMessages.deprecatedModules)
+ this.warn("deprecatedModules")
delete data.modules
}
}
}
if (data.keywords && !Array.isArray(data.keywords)) {
delete data.keywords
- this.warn(warningMessages.nonArrayKeywords)
+ this.warn("nonArrayKeywords")
} else if (data.keywords) {
data.keywords = data.keywords.filter(function(kw) {
if (typeof kw !== "string" || !kw) {
- this.warn(warningMessages.nonStringKeyword);
+ this.warn("nonStringKeyword");
return false
} else {
return true
data.name = data.name.trim()
ensureValidName(data.name, strict)
if (coreModuleNames.indexOf(data.name) !== -1)
- this.warn(format(warningMessages.conflictingName, data.name))
+ this.warn("conflictingName", data.name)
}
, fixDescriptionField: function (data) {
if (data.description && typeof data.description !== 'string') {
- this.warn(warningMessages.nonStringDescription)
+ this.warn("nonStringDescription")
delete data.description
}
if (data.readme && !data.description)
data.description = extractDescription(data.readme)
if(data.description === undefined) delete data.description;
- if (!data.description) this.warn(warningMessages.missingDescription)
+ if (!data.description) this.warn("missingDescription")
}
, fixReadmeField: function (data) {
if (!data.readme) {
- this.warn(warningMessages.missingReadme)
+ this.warn("missingReadme")
data.readme = "ERROR: No README data found!"
}
}
else if(url.parse(data.bugs).protocol)
data.bugs = {url: data.bugs}
else
- this.warn(warningMessages.nonEmailUrlBugsString)
+ this.warn("nonEmailUrlBugsString")
}
else {
bugsTypos(data.bugs, this.warn)
if(typeof(oldBugs.url) == "string" && url.parse(oldBugs.url).protocol)
data.bugs.url = oldBugs.url
else
- this.warn(warningMessages.nonUrlBugsUrlField)
+ this.warn("nonUrlBugsUrlField")
}
if(oldBugs.email) {
if(typeof(oldBugs.email) == "string" && emailRe.test(oldBugs.email))
data.bugs.email = oldBugs.email
else
- this.warn(warningMessages.nonEmailBugsEmailField)
+ this.warn("nonEmailBugsEmailField")
}
}
if(!data.bugs.email && !data.bugs.url) {
delete data.bugs
- this.warn(warningMessages.emptyNormalizedBugs)
+ this.warn("emptyNormalizedBugs")
}
}
}
return true
if(typeof data.homepage !== "string") {
- this.warn(warningMessages.nonUrlHomepage)
+ this.warn("nonUrlHomepage")
return delete data.homepage
}
if(!url.parse(data.homepage).protocol) {
- this.warn(warningMessages.missingProtocolHomepage)
+ this.warn("missingProtocolHomepage")
data.homepage = "http://" + data.homepage
}
}
deps = deps.trim().split(/[\n\r\s\t ,]+/)
}
if (!Array.isArray(deps)) return deps
- warn(format(warningMessages.deprecatedArrayDependencies, type))
+ warn("deprecatedArrayDependencies", type)
var o = {}
deps.filter(function (d) {
return typeof d === "string"
if (!bugs) return
Object.keys(bugs).forEach(function (k) {
if (typos.bugs[k]) {
- warn(makeTypoWarning(k, typos.bugs[k], "bugs"))
+ warn("typo", k, typos.bugs[k], "bugs")
bugs[typos.bugs[k]] = bugs[k]
delete bugs[k]
}
})
-}
-
-function makeTypoWarning (providedName, probableName, field) {
- if (field) {
- providedName = field + "['" + providedName + "']"
- probableName = field + "['" + probableName + "']"
- }
- return format(warningMessages.typo, providedName, probableName)
}
\ No newline at end of file
--- /dev/null
+var util = require("util")
+var messages = require("./warning_messages.json")
+
+module.exports = function() {
+ var args = Array.prototype.slice.call(arguments, 0)
+ var warningName = args.shift()
+ if (warningName == "typo") {
+ return makeTypoWarning.apply(null,args)
+ }
+ else {
+ var msgTemplate = messages[warningName] ? messages[warningName] : warningName + ": '%s'"
+ args.unshift(msgTemplate)
+ return util.format.apply(null, args)
+ }
+}
+
+function makeTypoWarning (providedName, probableName, field) {
+ if (field) {
+ providedName = field + "['" + providedName + "']"
+ probableName = field + "['" + probableName + "']"
+ }
+ return util.format(messages.typo, providedName, probableName)
+}
\ No newline at end of file
module.exports = normalize
var fixer = require("./fixer")
+var makeWarning = require("./make_warning")
var fieldsToFix = ['name','version','description','repository','modules','scripts'
,'files','bin','man','bugs','keywords','readme','homepage']
!data.scripts.preinstall) {
data.gypfile = true
}
- fixer.warn = warn
+ fixer.warn = function() { warn(makeWarning.apply(null, arguments)) }
thingsToFix.forEach(function(thingName) {
fixer["fix" + ucFirst(thingName)](data, strict)
})
{
"name": "normalize-package-data",
- "version": "0.2.12",
+ "version": "0.2.13",
"author": {
"name": "Meryn Stol",
"email": "merynstol@gmail.com"
"test": "tap test/*.js"
},
"dependencies": {
- "semver": "2",
"github-url-from-git": "~1.1.1",
- "github-url-from-username-repo": "0.0.2"
+ "github-url-from-username-repo": "^0.1.0",
+ "semver": "2"
},
"devDependencies": {
"tap": "~0.2.5",
"url": "https://github.com/meryn/normalize-package-data/issues"
},
"homepage": "https://github.com/meryn/normalize-package-data",
- "_id": "normalize-package-data@0.2.12",
- "_from": "normalize-package-data@~0.2.9"
+ "_id": "normalize-package-data@0.2.13",
+ "_shasum": "50f9fd9e77b1c8411cd231db2962e73963de774d",
+ "_from": "normalize-package-data@^0.2.13"
}
{
"name": "read-package-json",
- "version": "1.1.8",
+ "version": "1.1.9",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
"dependencies": {
"glob": "~3.2.1",
"lru-cache": "2",
- "normalize-package-data": "~0.2.9",
+ "normalize-package-data": "^0.2.13",
"graceful-fs": "2"
},
"devDependencies": {
"url": "https://github.com/isaacs/read-package-json/issues"
},
"homepage": "https://github.com/isaacs/read-package-json",
- "_id": "read-package-json@1.1.8",
+ "_id": "read-package-json@1.1.9",
+ "_shasum": "9c319185e5f8461661c01f8d4e5e80b468aa18ee",
"_from": "read-package-json@latest"
}
--- /dev/null
+Copyright (c) Isaac Z. Schlueter
+All rights reserved.
+
+The BSD License
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
{
- "version": "1.4.7",
+ "version": "1.4.8",
"name": "npm",
"publishConfig": {
"proprietary-attribs": false
"fstream": "~0.1.25",
"fstream-npm": "~0.1.6",
"github-url-from-git": "1.1.1",
- "github-url-from-username-repo": "0.0.2",
+ "github-url-from-username-repo": "~0.1.0",
"glob": "~3.2.9",
"graceful-fs": "~2.0.2",
"ini": "~1.1.0",
- "init-package-json": "0.0.15",
+ "init-package-json": "0.0.16",
"lockfile": "~0.4.0",
"lru-cache": "~2.5.0",
"minimatch": "~0.2.14",
"mkdirp": "~0.3.5",
"node-gyp": "~0.13.0",
- "nopt": "~2.2.0",
+ "nopt": "~2.2.1",
"npm-install-checks": "~1.0.0",
"npm-registry-client": "~0.4.7",
"npm-user-validate": "0.0.3",
- "npmconf": "~0.1.14",
+ "npmconf": "~0.1.15",
"npmlog": "0.0.6",
"once": "~1.3.0",
"opener": "~1.3.0",
"path-is-inside": "~1.0.0",
"read": "~1.0.4",
"read-installed": "~2.0.1",
- "read-package-json": "~1.1.8",
+ "read-package-json": "~1.1.9",
"request": "~2.30.0",
"retry": "~0.6.0",
"rimraf": "~2.2.5",
"devDependencies": {
"npm-registry-mock": "~0.6.3",
"ronn": "~0.3.6",
- "tap": "~0.4.0"
+ "tap": "~0.4.9"
},
"engines": {
"node": ">=0.8",
| sed "s|@VERSION@|$version|g" \
| perl -pi -e 's/<h1>([^\(]*\([0-9]\)) -- (.*?)<\/h1>/<h1>\1<\/h1> <p>\2<\/p>/g' \
| perl -pi -e 's/npm-npm/npm/g' \
- | perl -pi -e 's/([^"-])(npm-)?README(\(1\))?/\1<a href="..\/..\/doc\/README.html">README<\/a>/g' \
+ | perl -pi -e 's/([^"-])(npm-)?README(?!\.html)(\(1\))?/\1<a href="..\/..\/doc\/README.html">README<\/a>/g' \
| perl -pi -e 's/<title><a href="[^"]+README.html">README<\/a><\/title>/<title>README<\/title>/g' \
| perl -pi -e 's/([^"-])([^\(> ]+)(\(1\))/\1<a href="..\/cli\/\2.html">\2\3<\/a>/g' \
| perl -pi -e 's/([^"-])([^\(> ]+)(\(3\))/\1<a href="..\/api\/\2.html">\2\3<\/a>/g' \
+var spawn = require("child_process").spawn
+
var port = exports.port = 1337
exports.registry = "http://localhost:" + port
+process.env.npm_config_loglevel = "error"
+
+var bin = exports.bin = require.resolve("../bin/npm-cli.js")
+var once = require("once")
+exports.npm = function (cmd, opts, cb) {
+ cb = once(cb)
+ cmd = [bin].concat(cmd)
+ opts = opts || {}
+
+ var stdout = ""
+ , stderr = ""
+ , node = process.execPath
+ , child = spawn(node, cmd, opts)
+
+ if (child.stderr) child.stderr.on("data", function (chunk) {
+ stderr += chunk
+ })
+
+ if (child.stdout) child.stdout.on("data", function (chunk) {
+ stdout += chunk
+ })
+
+ child.on("error", cb)
+
+ child.on("close", function (code, signal) {
+ cb(null, code, stdout, stderr)
+ })
+}
--- /dev/null
+var common = require('../common-tap.js')
+var test = require('tap').test
+
+var server
+
+var port = common.port
+var http = require("http")
+
+var doc = {
+ "_id": "superfoo",
+ "_rev": "5-d11adeec0fdfea6b96b120610d2bed71",
+ "name": "superfoo",
+ "time": {
+ "modified": "2014-02-18T18:35:02.930Z",
+ "created": "2014-02-18T18:34:08.437Z",
+ "1.1.0": "2014-02-18T18:34:08.437Z",
+ "unpublished": {
+ "name": "isaacs",
+ "time": "2014-04-30T18:26:45.584Z",
+ "tags": {
+ "latest": "1.1.0"
+ },
+ "maintainers": [
+ {
+ "name": "foo",
+ "email": "foo@foo.com"
+ }
+ ],
+ "description": "do lots a foo",
+ "versions": [
+ "1.1.0"
+ ]
+ }
+ },
+ "_attachments": {}
+}
+
+test("setup", function (t) {
+ server = http.createServer(function(req, res) {
+ res.end(JSON.stringify(doc))
+ })
+ server.listen(port, function() {
+ t.end()
+ })
+})
+
+test("cache add", function (t) {
+ common.npm(["cache", "add", "superfoo"], {}, function (er, c, so, se) {
+ if (er) throw er
+ t.ok(c)
+ t.equal(so, "")
+ t.similar(se, /404 Not Found: superfoo/)
+ t.end()
+ })
+})
+
+test("cleanup", function (t) {
+ server.close(function() {
+ t.end()
+ })
+})
, existsSync = fs.existsSync || path.existsSync
, npm = require("../../")
, rimraf = require("rimraf")
+ , osenv = require("osenv")
, mr = require("npm-registry-mock")
, common = require("../common-tap.js")
, server
+var pkg = path.resolve(__dirname, "circular-dep")
+
test("installing a package that depends on the current package", function (t) {
t.plan(1)
if (err) return t.fail(err)
npm.dedupe(function(err) {
if (err) return t.fail(err)
- t.ok(existsSync(path.join(__dirname,
- "circular-dep", "minimist", "node_modules", "optimist",
+ t.ok(existsSync(path.resolve(pkg,
+ "minimist", "node_modules", "optimist",
"node_modules", "minimist"
)))
cleanup()
})
function setup (cb) {
- process.chdir(path.join(__dirname, "circular-dep", "minimist"))
cleanup()
- fs.mkdirSync(path.join(__dirname,
- "circular-dep", "minimist", "node_modules"))
+ process.chdir(path.resolve(pkg, "minimist"))
+
+ fs.mkdirSync(path.resolve(pkg, "minimist/node_modules"))
mr(common.port, function (s) {
server = s
npm.load({
+ loglevel: "silent",
registry: common.registry,
- cache: path.resolve(__dirname, "circular-dep", "cache")
+ cache: path.resolve(pkg, "cache")
}, cb)
})
}
function cleanup() {
- rimraf.sync(path.join(__dirname,
- "circular-dep", "minimist", "node_modules"))
- rimraf.sync(path.join(__dirname,
- "circular-dep", "cache"))
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(path.resolve(pkg, "minimist/node_modules"))
+ rimraf.sync(path.resolve(pkg, "cache"))
}
test("get lines", function (t) {
FILES.forEach(function (f) {
- console.error(f)
var lines = fs.readFileSync(f, 'utf8').split('\n')
lines.forEach(function (l, i) {
var matches = l.split(/conf(?:ig)?\.get\(/g)
DOC[ d[i].replace(/^### /, '').trim() ] = true
}
t.pass("read the docs")
- console.error(DOC)
t.end()
})
if (c !== 0)
return cb(new Error('Failed to init the git repository'))
- console.log('Successfully inited the git repository')
process.chdir(linkDir)
performLink(cb)
})
if (c !== 0)
return cb(new Error('Failed to link ' + linkDir + ' globally'))
- console.log('Successfully linked ' + linkDir + ' globally')
performLink2(cb)
})
}
if (c !== 0)
return cb(new Error('Failed to link ' + linkDir + ' to local node_modules'))
- console.log('Successfully linked ' + linkDir + ' to local node_modules')
performInstall(cb)
})
}
if (c !== 0)
return cb(new Error('Failed to install'))
- console.log('Successfully installed')
cb()
})
}
var env = {
HOME: process.env.HOME,
Path: process.env.PATH,
- PATH: process.env.PATH
+ PATH: process.env.PATH,
+ npm_config_loglevel: "silent"
}
if (process.platform === "win32")
return spawn(cmd, args, {
cwd: cwd,
- stdio: "inherit",
+ stdio: "pipe",
env: env
})
}
--- /dev/null
+var common = require('../common-tap.js')
+var test = require('tap').test
+var npm = require('../../')
+var mkdirp = require('mkdirp')
+var mr = require('npm-registry-mock')
+var exec = require('child_process').exec
+
+var pkg = __dirname + '/install-cli'
+var NPM_BIN = __dirname + '/../../bin/npm-cli.js'
+
+function hasOnlyAscii (s) {
+ return /^[\000-\177]*$/.test(s) ;
+}
+
+test('does not use unicode with --unicode false', function (t) {
+ t.plan(3)
+ mr(common.port, function (s) {
+ exec('node ' + NPM_BIN + ' install --unicode false read', {
+ cwd: pkg
+ }, function(err, stdout) {
+ t.ifError(err)
+ t.ok(stdout, stdout.length)
+ t.ok(hasOnlyAscii(stdout))
+ s.close()
+ })
+ })
+})
+
+test('cleanup', function (t) {
+ mr(common.port, function (s) {
+ exec('node ' + NPM_BIN + ' uninstall read', {
+ cwd: pkg
+ }, function(err, stdout) {
+ s.close()
+ })
+ })
+ t.end()
+})
--- /dev/null
+# Tests for `npm install` CLI output.
--- /dev/null
+module.exports = true
--- /dev/null
+{
+ "name": "install-cli",
+ "description": "fixture",
+ "version": "0.0.1",
+ "main": "index.js",
+ "dependencies": {
+ "read": "1.0.5"
+ },
+ "repository": "git://github.com/robertkowalski/bogusfixture"
+}
--- /dev/null
+var test = require("tap").test
+var node = process.execPath
+var common = require("../common-tap.js")
+
+var opts = { cwd: process.cwd() }
+
+test("npm asdf should return exit code 1", function(t) {
+ common.npm(["asdf"], opts, function (er, c) {
+ if (er) throw er
+ t.ok(c, "exit code should not be zero")
+ t.end()
+ })
+})
+
+test("npm help should return exit code 0", function(t) {
+ common.npm(["help"], opts, function (er, c) {
+ if (er) throw er
+ t.equal(c, 0, "exit code should be 0")
+ t.end()
+ })
+})
+
+test("npm help fadf should return exit code 0", function(t) {
+ common.npm(["help", "fadf"], opts, function (er, c) {
+ if (er) throw er
+ t.equal(c, 0, "exit code should be 0")
+ t.end()
+ })
+})
--- /dev/null
+var test = require("tap").test
+var npm = require('../../')
+var lifecycle = require('../../lib/utils/lifecycle')
+
+test("lifecycle: make env correctly", function (t) {
+ npm.load({enteente: Infinity}, function() {
+ var env = lifecycle.makeEnv({}, null, process.env)
+
+ t.equal('Infinity', env.npm_config_enteente)
+ t.end()
+ })
+})
--- /dev/null
+var common = require('../common-tap')
+ , test = require('tap').test
+ , path = require('path')
+ , rimraf = require('rimraf')
+ , osenv = require('osenv')
+ , mkdirp = require('mkdirp')
+ , pkg = __dirname + '/ls-depth'
+ , cache = pkg + '/cache'
+ , tmp = pkg + '/tmp'
+ , node = process.execPath
+ , npm = path.resolve(__dirname, '../../cli.js')
+ , mr = require('npm-registry-mock')
+ , opts = {cwd: pkg}
+
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg + '/cache')
+ rimraf.sync(pkg + '/tmp')
+ rimraf.sync(pkg + '/node_modules')
+}
+
+test('setup', function (t) {
+ cleanup()
+ mkdirp.sync(pkg + '/cache')
+ mkdirp.sync(pkg + '/tmp')
+ mr(common.port, function (s) {
+ var cmd = ['install', '--registry=' + common.registry]
+ common.npm(cmd, opts, function (er, c) {
+ if (er) throw er
+ t.equal(c, 0)
+ s.close()
+ t.end()
+ })
+ })
+})
+
+test('npm ls --depth=0', function (t) {
+ common.npm(['ls', '--depth=0'], opts, function (er, c, out) {
+ if (er) throw er
+ t.equal(c, 0)
+ t.has(out, /test-package-with-one-dep@0\.0\.0/
+ , "output contains test-package-with-one-dep@0.0.0")
+ t.doesNotHave(out, /test-package@0\.0\.0/
+ , "output not contains test-package@0.0.0")
+ t.end()
+ })
+})
+
+test('npm ls --depth=1', function (t) {
+ common.npm(['ls', '--depth=1'], opts, function (er, c, out) {
+ if (er) throw er
+ t.equal(c, 0)
+ t.has(out, /test-package-with-one-dep@0\.0\.0/
+ , "output contains test-package-with-one-dep@0.0.0")
+ t.has(out, /test-package@0\.0\.0/
+ , "output contains test-package@0.0.0")
+ t.end()
+ })
+})
+
+test('npm ls --depth=Infinity', function (t) {
+ // travis has a preconfigured depth=0, in general we can not depend
+ // on the default value in all environments, so explictly set it here
+ common.npm(['ls', '--depth=Infinity'], opts, function (er, c, out) {
+ if (er) throw er
+ t.equal(c, 0)
+ t.has(out, /test-package-with-one-dep@0\.0\.0/
+ , "output contains test-package-with-one-dep@0.0.0")
+ t.has(out, /test-package@0\.0\.0/
+ , "output contains test-package@0.0.0")
+ t.end()
+ })
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
--- /dev/null
+{
+ "author": "Rocko Artischocko",
+ "name": "ls-depth",
+ "version": "0.0.0",
+ "dependencies": {
+ "test-package-with-one-dep": "0.0.0"
+ }
+}
var common = require('../common-tap.js')
var fs = require("fs")
+var path = require("path")
var test = require("tap").test
var rimraf = require("rimraf")
var npm = require("../../")
-var http = require("http")
var mr = require("npm-registry-mock")
+var pkg = __dirname + "/peer-deps-invalid"
-var okFile = new Buffer(
-'/**package\n' +
-' * { "name": "npm-test-peer-deps-file"\n' +
-' * , "main": "index.js"\n' +
-' * , "version": "1.2.3"\n' +
-' * , "description":"No package.json in sight!"\n' +
-' * , "peerDependencies": { "underscore": "1.3.1" }\n' +
-' * , "dependencies": { "mkdirp": "0.3.5" }\n' +
-' * }\n' +
-' **/\n' +
-'\n' +
-'module.exports = "I\'m just a lonely index, naked as the day I was born."\n'
-)
-
-var failFile = new Buffer(
-'/**package\n' +
-' * { "name": "npm-test-peer-deps-file-invalid"\n' +
-' * , "main": "index.js"\n' +
-' * , "version": "1.2.3"\n' +
-' * , "description":"This one should conflict with the other one"\n' +
-' * , "peerDependencies": { "underscore": "1.3.3" }\n' +
-' * }\n' +
-' **/\n' +
-'\n' +
-'module.exports = "I\'m just a lonely index, naked as the day I was born."\n'
-)
-
-var server
-test("setup", function(t) {
- server = http.createServer(function (req, res) {
- res.setHeader('content-type', 'application/javascript')
- switch (req.url) {
- case "/ok.js":
- return res.end(okFile)
- default:
- return res.end(failFile)
- }
- })
- server.listen(common.port, function() {
- t.pass("listening")
- t.end()
- })
-})
-
-
+var okFile = fs.readFileSync(path.join(pkg, "file-ok.js"), "utf8")
+var failFile = fs.readFileSync(path.join(pkg, "file-fail.js"), "utf8")
test("installing dependencies that have conflicting peerDependencies", function (t) {
- rimraf.sync(__dirname + "/peer-deps-invalid/node_modules")
- process.chdir(__dirname + "/peer-deps-invalid")
-
- // we're already listening on common.port,
- // use an alternative port for this test.
- mr(1331, function (s) { // create mock registry.
- npm.load({registry: "http://localhost:1331"}, function () {
- console.error('back from load')
+ rimraf.sync(pkg + "/node_modules")
+ rimraf.sync(pkg + "/cache")
+ process.chdir(pkg)
+
+ var customMocks = {
+ "get": {
+ "/ok.js": [200, okFile],
+ "/invalid.js": [200, failFile]
+ }
+ }
+ mr({port: common.port, mocks: customMocks}, function (s) { // create mock registry.
+ npm.load({
+ cache: pkg + "/cache",
+ registry: common.registry
+ }, function () {
npm.commands.install([], function (err) {
- console.error('back from install')
if (!err) {
t.fail("No error!")
} else {
})
})
-test("shutdown", function(t) {
- server.close(function() {
- t.pass("closed")
- t.end()
- })
+test("cleanup", function (t) {
+ rimraf.sync(pkg + "/node_modules")
+ rimraf.sync(pkg + "/cache")
+ t.end()
})
--- /dev/null
+/**package
+* { "name": "npm-test-peer-deps-file-invalid"
+* , "main": "index.js"
+* , "version": "1.2.3"
+* , "description":"This one should conflict with the other one"
+* , "peerDependencies": { "underscore": "1.3.3" }
+* }
+**/
+
+module.exports = "I\'m just a lonely index, naked as the day I was born."
--- /dev/null
+/**package
+* { "name": "npm-test-peer-deps-file"
+* , "main": "index.js"
+* , "version": "1.2.3"
+* , "description":"No package.json in sight!"
+* , "peerDependencies": { "underscore": "1.3.1" }
+* , "dependencies": { "mkdirp": "0.3.5" }
+* }
+**/
+
+module.exports = "I\'m just a lonely index, naked as the day I was born."
var common = require('../common-tap.js')
var fs = require("fs")
+var path = require("path")
var test = require("tap").test
var rimraf = require("rimraf")
var npm = require("../../")
var mr = require("npm-registry-mock")
-var http = require("http")
-
-
-var js = new Buffer(
-'/**package\n' +
-' * { "name": "npm-test-peer-deps-file"\n' +
-' * , "main": "index.js"\n' +
-' * , "version": "1.2.3"\n' +
-' * , "description":"No package.json in sight!"\n' +
-' * , "peerDependencies": { "underscore": "1.3.1" }\n' +
-' * , "dependencies": { "mkdirp": "0.3.5" }\n' +
-' * }\n' +
-' **/\n' +
-'\n' +
-'module.exports = "I\'m just a lonely index, naked as the day I was born."\n')
-
-var server
-test("setup", function(t) {
- server = http.createServer(function (q, s) {
- s.setHeader('content-type', 'application/javascript')
- s.end(js)
- })
- server.listen(common.port, function () {
- t.pass('listening')
- t.end()
- })
-})
+var pkg = __dirname + "/peer-deps-without-package-json"
+var js = fs.readFileSync(path.join(pkg, "file-js.js"), "utf8")
test("installing a peerDependencies-using package without a package.json present (GH-3049)", function (t) {
- rimraf.sync(__dirname + "/peer-deps-without-package-json/node_modules")
- fs.mkdirSync(__dirname + "/peer-deps-without-package-json/node_modules")
- process.chdir(__dirname + "/peer-deps-without-package-json")
+ rimraf.sync(pkg + "/node_modules")
+ rimraf.sync(pkg + "/cache")
- // we're already listening on common.port,
- // use an alternative port for this test.
- mr(1331, function (s) { // create mock registry.
- npm.load({registry: 'http://localhost:1331'}, function () {
- npm.install(common.registry, function (err) {
+ fs.mkdirSync(pkg + "/node_modules")
+ process.chdir(pkg)
+
+ var customMocks = {
+ "get": {
+ "/ok.js": [200, js],
+ }
+ }
+ mr({port: common.port, mocks: customMocks}, function (s) { // create mock registry.
+ npm.load({
+ registry: common.registry,
+ cache: pkg + "/cache"
+ }, function () {
+ npm.install(common.registry + "/ok.js", function (err) {
if (err) {
t.fail(err)
} else {
- t.ok(fs.existsSync(__dirname + "/peer-deps-without-package-json/node_modules/npm-test-peer-deps-file"))
- t.ok(fs.existsSync(__dirname + "/peer-deps-without-package-json/node_modules/underscore"))
+ t.ok(fs.existsSync(pkg + "/node_modules/npm-test-peer-deps-file"))
+ t.ok(fs.existsSync(pkg + "/node_modules/underscore"))
}
t.end()
s.close() // shutdown mock registry.
})
test("cleanup", function (t) {
- server.close(function() {
- t.pass("closed")
- t.end()
- })
+ rimraf.sync(pkg + "/node_modules")
+ rimraf.sync(pkg + "/cache")
+ t.end()
})
--- /dev/null
+/**package
+* { "name": "npm-test-peer-deps-file"
+* , "main": "index.js"
+* , "version": "1.2.3"
+* , "description":"No package.json in sight!"
+* , "peerDependencies": { "underscore": "1.3.1" }
+* , "dependencies": { "mkdirp": "0.3.5" }
+* }
+**/
+
+module.exports = "I\'m just a lonely index, naked as the day I was born."
, tmp = pkg + '/tmp'
, node = process.execPath
, npm = path.resolve(__dirname, '../../cli.js')
+ , opts = { cwd: pkg }
-function run (command, t, parse) {
- var c = ''
- , e = ''
- , node = process.execPath
- , child = spawn(node, [npm, command], {
- cwd: pkg
- })
-
- child.stderr.on('data', function (chunk) {
- e += chunk
- })
+function testOutput (t, command, er, code, stdout, stderr) {
+ if (er)
+ throw er
- child.stdout.on('data', function (chunk) {
- c += chunk
- })
-
- child.stdout.on('end', function () {
- if (e) {
- throw new Error('npm ' + command + ' stderr: ' + e.toString())
- }
- if (parse) {
- // custom parsing function
- c = parse(c)
- t.equal(c.actual, c.expected)
- t.end()
- return
- }
-
- c = c.trim().split('\n')
- c = c[c.length - 1]
- t.equal(c, command)
- t.end()
- })
+ if (stderr)
+ throw new Error('npm ' + command + ' stderr: ' + stderr.toString())
+ stdout = stdout.trim().split('\n')
+ stdout = stdout[stdout.length - 1]
+ t.equal(stdout, command)
+ t.end()
}
function cleanup () {
mkdirp.sync(pkg + '/cache')
mkdirp.sync(pkg + '/tmp')
t.end()
-
})
test('npm start', function (t) {
- run('start', t)
+ common.npm(['start'], opts, testOutput.bind(null, t, "start"))
})
test('npm stop', function (t) {
- run('stop', t)
+ common.npm(['stop'], opts, testOutput.bind(null, t, "stop"))
})
test('npm restart', function (t) {
- run ('restart', t, function (output) {
- output = output.split('\n').filter(function (val) {
+ common.npm(['restart'], opts, function (er, c, stdout, stderr) {
+ if (er)
+ throw er
+
+ var output = stdout.split('\n').filter(function (val) {
return val.match(/^s/)
})
- return {actual: output, expected: output}
+
+ t.same(output.sort(), ['start', 'stop'].sort())
+ t.end()
})
})
--- /dev/null
+box: wercker/nodejs
+# Build definition
+build:
+ # The steps that will be executed on build
+ steps:
+ # A step that executes `npm install` command
+ - npm-install
+ # A step that executes `npm test` command
+ - npm-test
+
+ # A custom script step, name value is used in the UI
+ # and the code value contains the command that get executed
+ - script:
+ name: echo nodejs information
+ code: |
+ echo "node version $(node -v) running"
+ echo "npm version $(npm -v) running"
+ after-steps:
+ - sherzberg/slack-notify:
+ subdomain: npm-inc
+ token: $SLACK_TOKEN
+ channel: github-commits