Henrik Hodne <dvyjones@binaryhex.com>
Adam Blackburn <regality@gmail.com>
Kris Windham <kriswindham@gmail.com>
+Jens Grunert <jens.grunert@gmail.com>
+Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl>
+Dalmais Maxence <github@maxired.fr>
* `-l`: `--long`
* `-desc`: `--description`
* `-S`: `--save`
+* `-D`: `--save-dev`
+* `-O`: `--save-optional`
* `-y`: `--yes`
* `-n`: `--yes false`
* `ll` and `la` commands: `ls --long`
A proxy to use for outgoing https requests.
+### user-agent
+
+* Default: npm/{npm.version} node/{process.version}
+* Type: String
+
+Sets a User-Agent to the request header
+
### ignore
* Default: ""
Only works if there is already a package.json file present.
+### save-dev
+
+* Default: false
+* Type: Boolean
+
+Save installed packages to a package.json file as devDependencies.
+
+Only works if there is already a package.json file present.
+
+### save-optional
+
+* Default: false
+* Type: Boolean
+
+Save installed packages to a package.json file as optionalDependencies.
+
+Only works if there is already a package.json file present.
+
### searchopts
* Default: ""
npm install <tarball file>
npm install <tarball url>
npm install <folder>
- npm install <name>
+ npm install <name> [--save|--save-dev|--save-optional]
npm install <name>@<tag>
npm install <name>@<version>
npm install <name>@<version range>
+ npm install <name>@<version range>
## DESCRIPTION
* `npm install` (in package directory, no arguments):
- Install the dependencies in the local node_modules folder.
- In global mode (ie, with `-g` or `--global` appended to the command),
- it installs the current package context (ie, the current working
- directory) as a global package.
+ Install the dependencies in the local node_modules folder.
+
+ In global mode (ie, with `-g` or `--global` appended to the command),
+ it installs the current package context (ie, the current working
+ directory) as a global package.
+
* `npm install <folder>`:
- Install a package that is sitting in a folder on the filesystem.
+
+ Install a package that is sitting in a folder on the filesystem.
* `npm install <tarball file>`:
- Install a package that is sitting on the filesystem. Note: if you just want
- to link a dev directory into your npm root, you can do this more easily by
- using `npm link`.
- Example:
+ Install a package that is sitting on the filesystem. Note: if you just want
+ to link a dev directory into your npm root, you can do this more easily by
+ using `npm link`.
+
+ Example:
- npm install ./package.tgz
+ npm install ./package.tgz
* `npm install <tarball url>`:
- Fetch the tarball url, and then install it. In order to distinguish between
- this and other options, the argument must start with "http://" or "https://"
- Example:
+ Fetch the tarball url, and then install it. In order to distinguish between
+ this and other options, the argument must start with "http://" or "https://"
+
+ Example:
+
+ npm install https://github.com/indexzero/forever/tarball/v0.5.6
+
+* `npm install <name> [--save|--save-dev|--save-optional]`:
+
+ Do a `<name>@<tag>` install, where `<tag>` is the "tag" config. (See
+ `npm-config(1)`.)
- npm install https://github.com/indexzero/forever/tarball/v0.5.6
+ In most cases, this will install the latest version
+ of the module published on npm.
-* `npm install <name>`:
- Do a `<name>@<tag>` install, where `<tag>` is the "tag" config. (See
- `npm-config(1)`)
+ Example:
- Example:
+ npm install sax
- npm install sax
+ `npm install` takes 3 exclusive, optional flags which save or update
+ the package version in your main package.json:
- **Note**: If there is a file or folder named `<name>` in the current
- working directory, then it will try to install that, and only try to
- fetch the package by name if it is not valid.
+ * `--save`: Package will appear in your `dependencies`.
+
+ * `--save-dev`: Package will appear in your `devDependencies`.
+
+ * `--save-optional`: Package will appear in your `optionalDependencies`.
+
+ Examples:
+
+ npm install sax --save
+ npm install node-tap --save-dev
+ npm install dtrace-provider --save-optional
+
+
+ **Note**: If there is a file or folder named `<name>` in the current
+ working directory, then it will try to install that, and only try to
+ fetch the package by name if it is not valid.
* `npm install <name>@<tag>`:
- Install the version of the package that is referenced by the specified tag.
- If the tag does not exist in the registry data for that package, then this
- will fail.
- Example:
+ Install the version of the package that is referenced by the specified tag.
+ If the tag does not exist in the registry data for that package, then this
+ will fail.
+
+ Example:
- npm install sax@latest
+ npm install sax@latest
* `npm install <name>@<version>`:
- Install the specified version of the package. This will fail if the version
- has not been published to the registry.
- Example:
+ Install the specified version of the package. This will fail if the version
+ has not been published to the registry.
- npm install sax@0.1.1
+ Example:
+
+ npm install sax@0.1.1
* `npm install <name>@<version range>`:
- Install a version of the package matching the specified version range. This
- will follow the same rules for resolving dependencies described in `npm-json(1)`.
- Note that most version ranges must be put in quotes so that your shell will
- treat it as a single argument.
+ Install a version of the package matching the specified version range. This
+ will follow the same rules for resolving dependencies described in `npm-json(1)`.
+
+ Note that most version ranges must be put in quotes so that your shell will
+ treat it as a single argument.
- Example:
+ Example:
- npm install sax@">=0.1.0 <0.2.0"
+ npm install sax@">=0.1.0 <0.2.0"
* `npm install <git remote url>`:
- Install a package by cloning a git remote url. The format of the git
- url is:
+ Install a package by cloning a git remote url. The format of the git
+ url is:
- <protocol>://[<user>@]<hostname><separator><path>[#<commit-ish>]
+ <protocol>://[<user>@]<hostname><separator><path>[#<commit-ish>]
- `<protocol>` is one of `git`, `git+ssh`, `git+http`, or
- `git+https`. If no `<commit-ish>` is specified, then `master` is
- used.
+ `<protocol>` is one of `git`, `git+ssh`, `git+http`, or
+ `git+https`. If no `<commit-ish>` is specified, then `master` is
+ used.
- Examples:
+ Examples:
- git+ssh://git@github.com:isaacs/npm.git#v1.0.27
- git+https://isaacs@github.com/isaacs/npm.git
- git://github.com/isaacs/npm.git#v1.0.27
+ git+ssh://git@github.com:isaacs/npm.git#v1.0.27
+ git+https://isaacs@github.com/isaacs/npm.git
+ git://github.com/isaacs/npm.git#v1.0.27
You may combine multiple arguments, and even multiple types of arguments.
For example:
This is a way to prevent accidental publication of private repositories.
If you would like to ensure that a given package is only ever published
-to a speciic registry (for example, an internal registry),
+to a specific registry (for example, an internal registry),
then use the `publishConfig` hash described below
to override the `registry` config param at publish-time.
<p>This function should not be used programmatically. Instead, just refer
to the <code>npm.bin</code> member.</p>
</div>
-<p id="footer">bin — npm@1.1.15</p>
+<p id="footer">bin — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This command will launch a browser, so this command may not be the most
friendly for programmatic use.</p>
</div>
-<p id="footer">bugs — npm@1.1.15</p>
+<p id="footer">bugs — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/index.html">index(1)</a></li></ul>
</div>
-<p id="footer">commands — npm@1.1.15</p>
+<p id="footer">commands — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../api/npm.html">npm(3)</a></li></ul>
</div>
-<p id="footer">config — npm@1.1.15</p>
+<p id="footer">config — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../api/publish.html">publish(3)</a></li><li><a href="../api/unpublish.html">unpublish(3)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
</div>
-<p id="footer">deprecate — npm@1.1.15</p>
+<p id="footer">deprecate — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This command will launch a browser, so this command may not be the most
friendly for programmatic use.</p>
</div>
-<p id="footer">docs — npm@1.1.15</p>
+<p id="footer">docs — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Since this command opens an editor in a new process, be careful about where
and how this is used.</p>
</div>
-<p id="footer">edit — npm@1.1.15</p>
+<p id="footer">edit — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>The first element in the 'args' parameter must be a package name. After that is the optional command, which can be any number of strings. All of the strings will be combined into one, space-delimited command.</p>
</div>
-<p id="footer">explore — npm@1.1.15</p>
+<p id="footer">explore — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>The silent parameter is not neccessary not used, but it may in the future.</p>
</div>
-<p id="footer">help-search — npm@1.1.15</p>
+<p id="footer">help-search — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p><a href="../doc/json.html">json(1)</a></p>
</div>
-<p id="footer">init — npm@1.1.15</p>
+<p id="footer">init — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Finally, 'callback' is a function that will be called when all packages have been
installed or when an error has been encountered.</p>
</div>
-<p id="footer">install — npm@1.1.15</p>
+<p id="footer">install — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Now, any changes to the redis package will be reflected in
the package in the current working directory</p>
</div>
-<p id="footer">link — npm@1.1.15</p>
+<p id="footer">link — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>For a list of all the available command-line configs, see <code>npm help config</code></p>
</div>
-<p id="footer">load — npm@1.1.15</p>
+<p id="footer">load — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
This means that if a submodule a same dependency as a parent module, then the
dependency will only be output once.</p>
</div>
-<p id="footer">ls — npm@1.1.15</p>
+<p id="footer">ls — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="VERSION">VERSION</h2>
-<p>1.1.15</p>
+<p>1.1.18</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<pre><code>var cmd = npm.deref("unp") // cmd === "unpublish"</code></pre>
</div>
-<p id="footer">npm — npm@1.1.15</p>
+<p id="footer">npm — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>If the 'packages' parameter is left out, npm will check all packages.</p>
</div>
-<p id="footer">outdated — npm@1.1.15</p>
+<p id="footer">outdated — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../api/publish.html">publish(3)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
</div>
-<p id="footer">owner — npm@1.1.15</p>
+<p id="footer">owner — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>If no arguments are supplied, then npm packs the current package folder.</p>
</div>
-<p id="footer">pack — npm@1.1.15</p>
+<p id="footer">pack — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This function is not useful programmatically</p>
</div>
-<p id="footer">prefix — npm@1.1.15</p>
+<p id="footer">prefix — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Extraneous packages are packages that are not listed on the parent
package's dependencies list.</p>
</div>
-<p id="footer">prune — npm@1.1.15</p>
+<p id="footer">prune — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../api/owner.html">owner(3)</a></li></ul>
</div>
-<p id="footer">publish — npm@1.1.15</p>
+<p id="footer">publish — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>See <code>npm help build</code></p>
</div>
-<p id="footer">rebuild — npm@1.1.15</p>
+<p id="footer">rebuild — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../api/start.html">start(3)</a></li><li><a href="../api/stop.html">stop(3)</a></li></ul>
</div>
-<p id="footer">restart — npm@1.1.15</p>
+<p id="footer">restart — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This function is not useful programmatically.</p>
</div>
-<p id="footer">root — npm@1.1.15</p>
+<p id="footer">root — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../api/test.html">test(3)</a></li><li><a href="../api/start.html">start(3)</a></li><li><a href="../api/restart.html">restart(3)</a></li><li><a href="../api/stop.html">stop(3)</a></li></ul>
</div>
-<p id="footer">run-script — npm@1.1.15</p>
+<p id="footer">run-script — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
and doesn't try to read your mind (it doesn't do any verb tense matching or the
like).</p>
</div>
-<p id="footer">search — npm@1.1.15</p>
+<p id="footer">search — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Finally, 'callback' is a function that will be called when the shrinkwrap has
been saved.</p>
</div>
-<p id="footer">shrinkwrap — npm@1.1.15</p>
+<p id="footer">shrinkwrap — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>npm can run tests on multiple packages. Just specify multiple packages
in the <code>packages</code> parameter.</p>
</div>
-<p id="footer">start — npm@1.1.15</p>
+<p id="footer">start — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>npm can run stop on multiple packages. Just specify multiple packages
in the <code>packages</code> parameter.</p>
</div>
-<p id="footer">stop — npm@1.1.15</p>
+<p id="footer">stop — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li>npm help json</li><li>git help submodule</li></ul>
</div>
-<p id="footer">submodule — npm@1.1.15</p>
+<p id="footer">submodule — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
used. For more information about how to set this config, check
<code>man 3 npm-config</code> for programmatic usage or <code>man npm-config</code> for cli usage.</p>
</div>
-<p id="footer">tag — npm@1.1.15</p>
+<p id="footer">tag — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>npm can run tests on multiple packages. Just specify multiple packages
in the <code>packages</code> parameter.</p>
</div>
-<p id="footer">test — npm@1.1.15</p>
+<p id="footer">test — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Finally, 'callback' is a function that will be called when all packages have been
uninstalled or when an error has been encountered.</p>
</div>
-<p id="footer">uninstall — npm@1.1.15</p>
+<p id="footer">uninstall — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>If no version is specified, or if all versions are removed then
the root package entry is removed from the registry entirely.</p>
</div>
-<p id="footer">unpublish — npm@1.1.15</p>
+<p id="footer">unpublish — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>The 'packages' argument is an array of packages to update. The 'callback' parameter will be called when done or when an error occurs.</p>
</div>
-<p id="footer">update — npm@1.1.15</p>
+<p id="footer">update — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
parameter. The difference, however, is this function will fail if it does
not have exactly one element. The only element should be a version number.</p>
</div>
-<p id="footer">version — npm@1.1.15</p>
+<p id="footer">version — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>corresponding to the list of fields selected.</p>
</div>
-<p id="footer">view — npm@1.1.15</p>
+<p id="footer">view — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This function is not useful programmatically</p>
</div>
-<p id="footer">whoami — npm@1.1.15</p>
+<p id="footer">whoami — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/help.html">help(1)</a></li><li><a href="../doc/index.html">index(1)</a></li></ul>
</div>
-<p id="footer"><a href="../doc/README.html">README</a> — npm@1.1.15</p>
+<p id="footer"><a href="../doc/README.html">README</a> — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/owner.html">owner(1)</a></li><li><a href="../doc/whoami.html">whoami(1)</a></li></ul>
</div>
-<p id="footer">adduser — npm@1.1.15</p>
+<p id="footer">adduser — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/prefix.html">prefix(1)</a></li><li><a href="../doc/root.html">root(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">bin — npm@1.1.15</p>
+<p id="footer">bin — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/docs.html">docs(1)</a></li><li><a href="../doc/view.html">view(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/json.html">json(1)</a></li></ul>
</div>
-<p id="footer">bugs — npm@1.1.15</p>
+<p id="footer">bugs — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/link.html">link(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/json.html">json(1)</a></li></ul>
</div>
-<p id="footer">build — npm@1.1.15</p>
+<p id="footer">build — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/install.html">install(1)</a></li></ul>
</div>
-<p id="footer">bundle — npm@1.1.15</p>
+<p id="footer">bundle — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/pack.html">pack(1)</a></li></ul>
</div>
-<p id="footer">cache — npm@1.1.15</p>
+<p id="footer">cache — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li></ul>
</div>
-<p id="footer">changelog — npm@1.1.15</p>
+<p id="footer">changelog — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">coding-style — npm@1.1.15</p>
+<p id="footer">coding-style — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">completion — npm@1.1.15</p>
+<p id="footer">completion — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>The following shorthands are parsed on the command-line:</p>
-<ul><li><code>-v</code>: <code>--version</code></li><li><code>-h</code>, <code>-?</code>, <code>--help</code>, <code>-H</code>: <code>--usage</code></li><li><code>-s</code>, <code>--silent</code>: <code>--loglevel silent</code></li><li><code>-q</code>, <code>--quiet</code>: <code>--loglevel warn</code></li><li><code>-d</code>: <code>--loglevel info</code></li><li><code>-dd</code>, <code>--verbose</code>: <code>--loglevel verbose</code></li><li><code>-ddd</code>: <code>--loglevel silly</code></li><li><code>-g</code>: <code>--global</code></li><li><code>-l</code>: <code>--long</code></li><li><code>-m</code>: <code>--message</code></li><li><code>-p</code>, <code>--porcelain</code>: <code>--parseable</code></li><li><code>-reg</code>: <code>--registry</code></li><li><code>-v</code>: <code>--version</code></li><li><code>-f</code>: <code>--force</code></li><li><code>-l</code>: <code>--long</code></li><li><code>-desc</code>: <code>--description</code></li><li><code>-S</code>: <code>--save</code></li><li><code>-y</code>: <code>--yes</code></li><li><code>-n</code>: <code>--yes false</code></li><li><code>ll</code> and <code>la</code> commands: <code>ls --long</code></li></ul>
+<ul><li><code>-v</code>: <code>--version</code></li><li><code>-h</code>, <code>-?</code>, <code>--help</code>, <code>-H</code>: <code>--usage</code></li><li><code>-s</code>, <code>--silent</code>: <code>--loglevel silent</code></li><li><code>-q</code>, <code>--quiet</code>: <code>--loglevel warn</code></li><li><code>-d</code>: <code>--loglevel info</code></li><li><code>-dd</code>, <code>--verbose</code>: <code>--loglevel verbose</code></li><li><code>-ddd</code>: <code>--loglevel silly</code></li><li><code>-g</code>: <code>--global</code></li><li><code>-l</code>: <code>--long</code></li><li><code>-m</code>: <code>--message</code></li><li><code>-p</code>, <code>--porcelain</code>: <code>--parseable</code></li><li><code>-reg</code>: <code>--registry</code></li><li><code>-v</code>: <code>--version</code></li><li><code>-f</code>: <code>--force</code></li><li><code>-l</code>: <code>--long</code></li><li><code>-desc</code>: <code>--description</code></li><li><code>-S</code>: <code>--save</code></li><li><code>-D</code>: <code>--save-dev</code></li><li><code>-O</code>: <code>--save-optional</code></li><li><code>-y</code>: <code>--yes</code></li><li><code>-n</code>: <code>--yes false</code></li><li><code>ll</code> and <code>la</code> commands: <code>ls --long</code></li></ul>
<p>If the specified configuration param resolves unambiguously to a known
configuration parameter, then it is expanded to that configuration
<p>A proxy to use for outgoing https requests.</p>
+<h3 id="user-agent">user-agent</h3>
+
+<ul><li>Default: npm/{npm.version} node/{process.version}</li><li>Type: String</li></ul>
+
+<p>Sets a User-Agent to the request header</p>
+
<h3 id="ignore">ignore</h3>
<ul><li>Default: ""</li><li>Type: string</li></ul>
<p>Only works if there is already a package.json file present.</p>
+<h3 id="save-dev">save-dev</h3>
+
+<ul><li>Default: false</li><li>Type: Boolean</li></ul>
+
+<p>Save installed packages to a package.json file as devDependencies.</p>
+
+<p>Only works if there is already a package.json file present.</p>
+
+<h3 id="save-optional">save-optional</h3>
+
+<ul><li>Default: false</li><li>Type: Boolean</li></ul>
+
+<p>Save installed packages to a package.json file as optionalDependencies.</p>
+
+<p>Only works if there is already a package.json file present.</p>
+
<h3 id="searchopts">searchopts</h3>
<ul><li>Default: ""</li><li>Type: String</li></ul>
<ul><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">config — npm@1.1.15</p>
+<p id="footer">config — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
</div>
-<p id="footer">deprecate — npm@1.1.15</p>
+<p id="footer">deprecate — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/init.html">init(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
</div>
-<p id="footer">developers — npm@1.1.15</p>
+<p id="footer">developers — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/owner.html">owner(1)</a></li></ul>
</div>
-<p id="footer">disputes — npm@1.1.15</p>
+<p id="footer">disputes — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/view.html">view(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/json.html">json(1)</a></li></ul>
</div>
-<p id="footer">docs — npm@1.1.15</p>
+<p id="footer">docs — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/explore.html">explore(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">edit — npm@1.1.15</p>
+<p id="footer">edit — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/submodule.html">submodule(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/edit.html">edit(1)</a></li><li><a href="../doc/rebuild.html">rebuild(1)</a></li><li><a href="../doc/build.html">build(1)</a></li><li><a href="../doc/install.html">install(1)</a></li></ul>
</div>
-<p id="footer">explore — npm@1.1.15</p>
+<p id="footer">explore — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li></ul>
</div>
-<p id="footer">faq — npm@1.1.15</p>
+<p id="footer">faq — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/pack.html">pack(1)</a></li><li><a href="../doc/cache.html">cache(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li></ul>
</div>
-<p id="footer">folders — npm@1.1.15</p>
+<p id="footer">folders — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/help.html">help(1)</a></li></ul>
</div>
-<p id="footer">help-search — npm@1.1.15</p>
+<p id="footer">help-search — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/README.html">README</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/help-search.html">help-search(1)</a></li><li><a href="../doc/index.html">index(1)</a></li></ul>
</div>
-<p id="footer">help — npm@1.1.15</p>
+<p id="footer">help — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p> Display npm username</p>
</div>
-<p id="footer">index — npm@1.1.15</p>
+<p id="footer">index — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/version.html">version(1)</a></li></ul>
</div>
-<p id="footer">init — npm@1.1.15</p>
+<p id="footer">init — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
npm install <tarball file>
npm install <tarball url>
npm install <folder>
-npm install <name>
+npm install <name> [--save|--save-dev|--save-optional]
npm install <name>@<tag>
npm install <name>@<version>
+npm install <name>@<version range>
npm install <name>@<version range></code></pre>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
perhaps if you also want to be able to easily install it elsewhere
after packing it up into a tarball (b).</p>
-<ul><li><p><code>npm install</code> (in package directory, no arguments):
-Install the dependencies in the local node_modules folder.</p><p>In global mode (ie, with <code>-g</code> or <code>--global</code> appended to the command),
+<ul><li><p><code>npm install</code> (in package directory, no arguments):</p><p>Install the dependencies in the local node_modules folder.</p><p>In global mode (ie, with <code>-g</code> or <code>--global</code> appended to the command),
it installs the current package context (ie, the current working
-directory) as a global package.</p></li><li><p><code>npm install <folder></code>:
-Install a package that is sitting in a folder on the filesystem.</p></li><li><p><code>npm install <tarball file></code>:
-Install a package that is sitting on the filesystem. Note: if you just want
+directory) as a global package.</p></li><li><p><code>npm install <folder></code>:</p><p>Install a package that is sitting in a folder on the filesystem.</p></li><li><p><code>npm install <tarball file></code>:</p><p>Install a package that is sitting on the filesystem. Note: if you just want
to link a dev directory into your npm root, you can do this more easily by
-using <code>npm link</code>.</p><p>Example:</p><pre><code>npm install ./package.tgz</code></pre></li><li><p><code>npm install <tarball url></code>:
-Fetch the tarball url, and then install it. In order to distinguish between
-this and other options, the argument must start with "http://" or "https://"</p><p>Example:</p><pre><code>npm install https://github.com/indexzero/forever/tarball/v0.5.6</code></pre></li><li><p><code>npm install <name></code>:
-Do a <code><name>@<tag></code> install, where <code><tag></code> is the "tag" config. (See
-<code><a href="../doc/config.html">config(1)</a></code>)</p><p>Example:</p><pre><code>npm install sax</code></pre><p><strong>Note</strong>: If there is a file or folder named <code><name></code> in the current
+using <code>npm link</code>.</p><p>Example:</p><pre><code> npm install ./package.tgz</code></pre></li><li><p><code>npm install <tarball url></code>:</p><p>Fetch the tarball url, and then install it. In order to distinguish between
+this and other options, the argument must start with "http://" or "https://"</p><p>Example:</p><pre><code> npm install https://github.com/indexzero/forever/tarball/v0.5.6</code></pre></li><li><p><code>npm install <name> [--save|--save-dev|--save-optional]</code>:</p><p>Do a <code><name>@<tag></code> install, where <code><tag></code> is the "tag" config. (See
+<code><a href="../doc/config.html">config(1)</a></code>.)</p><p>In most cases, this will install the latest version
+of the module published on npm.</p><p>Example:</p><p> npm install sax</p><p><code>npm install</code> takes 3 exclusive, optional flags which save or update
+the package version in your main package.json:</p><ul><li><p><code>--save</code>: Package will appear in your <code>dependencies</code>.</p></li><li><p><code>--save-dev</code>: Package will appear in your <code>devDependencies</code>.</p></li><li><p><code>--save-optional</code>: Package will appear in your <code>optionalDependencies</code>.</p><p>Examples:</p><p> npm install sax --save
+ npm install node-tap --save-dev
+ npm install dtrace-provider --save-optional</p><p><strong>Note</strong>: If there is a file or folder named <code><name></code> in the current
working directory, then it will try to install that, and only try to
-fetch the package by name if it is not valid.</p></li><li><p><code>npm install <name>@<tag></code>:
-Install the version of the package that is referenced by the specified tag.
+fetch the package by name if it is not valid.</p></li></ul></li><li><p><code>npm install <name>@<tag></code>:</p><p>Install the version of the package that is referenced by the specified tag.
If the tag does not exist in the registry data for that package, then this
-will fail.</p><p>Example:</p><pre><code>npm install sax@latest</code></pre></li><li><p><code>npm install <name>@<version></code>:
-Install the specified version of the package. This will fail if the version
-has not been published to the registry.</p><p>Example:</p><pre><code>npm install sax@0.1.1</code></pre></li><li><p><code>npm install <name>@<version range></code>:
-Install a version of the package matching the specified version range. This
+will fail.</p><p>Example:</p><pre><code> npm install sax@latest</code></pre></li><li><p><code>npm install <name>@<version></code>:</p><p>Install the specified version of the package. This will fail if the version
+has not been published to the registry.</p><p>Example:</p><pre><code> npm install sax@0.1.1</code></pre></li><li><p><code>npm install <name>@<version range></code>:</p><p>Install a version of the package matching the specified version range. This
will follow the same rules for resolving dependencies described in <code><a href="../doc/json.html">json(1)</a></code>.</p><p>Note that most version ranges must be put in quotes so that your shell will
-treat it as a single argument.</p><p>Example:</p><pre><code>npm install sax@">=0.1.0 <0.2.0"</code></pre></li><li><p><code>npm install <git remote url></code>:</p><p>Install a package by cloning a git remote url. The format of the git
-url is:</p><pre><code><protocol>://[<user>@]<hostname><separator><path>[#<commit-ish>]</code></pre><p><code><protocol></code> is one of <code>git</code>, <code>git+ssh</code>, <code>git+http</code>, or
+treat it as a single argument.</p><p>Example:</p><p> npm install sax@">=0.1.0 <0.2.0"</p></li><li><p><code>npm install <git remote url></code>:</p><p>Install a package by cloning a git remote url. The format of the git
+url is:</p><p> <protocol>://[<user>@]<hostname><separator><path>[#<commit-ish>]</p><p><code><protocol></code> is one of <code>git</code>, <code>git+ssh</code>, <code>git+http</code>, or
<code>git+https</code>. If no <code><commit-ish></code> is specified, then <code>master</code> is
-used.</p><p>Examples:</p><pre><code>git+ssh://git@github.com:isaacs/npm.git#v1.0.27
-git+https://isaacs@github.com/isaacs/npm.git
-git://github.com/isaacs/npm.git#v1.0.27</code></pre></li></ul>
+used.</p><p>Examples:</p><pre><code> git+ssh://git@github.com:isaacs/npm.git#v1.0.27
+ git+https://isaacs@github.com/isaacs/npm.git
+ git://github.com/isaacs/npm.git#v1.0.27</code></pre></li></ul>
<p>You may combine multiple arguments, and even multiple types of arguments.
For example:</p>
<ul><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/update.html">update(1)</a></li><li><a href="../doc/link.html">link(1)</a></li><li><a href="../doc/rebuild.html">rebuild(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/build.html">build(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/tag.html">tag(1)</a></li><li><a href="../doc/rm.html">rm(1)</a></li><li><a href="../doc/shrinkwrap.html">shrinkwrap(1)</a></li></ul>
</div>
-<p id="footer">install — npm@1.1.15</p>
+<p id="footer">install — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This is a way to prevent accidental publication of private repositories.
If you would like to ensure that a given package is only ever published
-to a speciic registry (for example, an internal registry),
+to a specific registry (for example, an internal registry),
then use the <code>publishConfig</code> hash described below
to override the <code>registry</code> config param at publish-time.</p>
<ul><li><a href="../doc/semver.html">semver(1)</a></li><li><a href="../doc/init.html">init(1)</a></li><li><a href="../doc/version.html">version(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/help.html">help(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/rm.html">rm(1)</a></li></ul>
</div>
-<p id="footer">json — npm@1.1.15</p>
+<p id="footer">json — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">link — npm@1.1.15</p>
+<p id="footer">link — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/link.html">link(1)</a></li><li><a href="../doc/prune.html">prune(1)</a></li><li><a href="../doc/outdated.html">outdated(1)</a></li><li><a href="../doc/update.html">update(1)</a></li></ul>
</div>
-<p id="footer">list — npm@1.1.15</p>
+<p id="footer">list — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="VERSION">VERSION</h2>
-<p>1.1.15</p>
+<p>1.1.18</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<ul><li><a href="../doc/help.html">help(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/README.html">README</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/index.html">index(1)</a></li><li><a href="../api/npm.html">npm(3)</a></li></ul>
</div>
-<p id="footer">npm — npm@1.1.15</p>
+<p id="footer">npm — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/update.html">update(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li></ul>
</div>
-<p id="footer">outdated — npm@1.1.15</p>
+<p id="footer">outdated — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../doc/disputes.html">disputes(1)</a></li></ul>
</div>
-<p id="footer">owner — npm@1.1.15</p>
+<p id="footer">owner — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/cache.html">cache(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">pack — npm@1.1.15</p>
+<p id="footer">pack — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/root.html">root(1)</a></li><li><a href="../doc/bin.html">bin(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">prefix — npm@1.1.15</p>
+<p id="footer">prefix — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/rm.html">rm(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/list.html">list(1)</a></li></ul>
</div>
-<p id="footer">prune — npm@1.1.15</p>
+<p id="footer">prune — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../doc/owner.html">owner(1)</a></li><li><a href="../doc/deprecate.html">deprecate(1)</a></li><li><a href="../doc/tag.html">tag(1)</a></li></ul>
</div>
-<p id="footer">publish — npm@1.1.15</p>
+<p id="footer">publish — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/build.html">build(1)</a></li><li><a href="../doc/install.html">install(1)</a></li></ul>
</div>
-<p id="footer">rebuild — npm@1.1.15</p>
+<p id="footer">rebuild — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/disputes.html">disputes(1)</a></li></ul>
</div>
-<p id="footer">registry — npm@1.1.15</p>
+<p id="footer">registry — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/README.html">README</a></li><li><a href="../doc/rm.html">rm(1)</a></li><li><a href="../doc/prune.html">prune(1)</a></li></ul>
</div>
-<p id="footer">removing-npm — npm@1.1.15</p>
+<p id="footer">removing-npm — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/run-script.html">run-script(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/test.html">test(1)</a></li><li><a href="../doc/start.html">start(1)</a></li><li><a href="../doc/stop.html">stop(1)</a></li></ul>
</div>
-<p id="footer">restart — npm@1.1.15</p>
+<p id="footer">restart — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/prefix.html">prefix(1)</a></li><li><a href="../doc/bin.html">bin(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">root — npm@1.1.15</p>
+<p id="footer">root — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/test.html">test(1)</a></li><li><a href="../doc/start.html">start(1)</a></li><li><a href="../doc/restart.html">restart(1)</a></li><li><a href="../doc/stop.html">stop(1)</a></li></ul>
</div>
-<p id="footer">run-script — npm@1.1.15</p>
+<p id="footer">run-script — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/run-script.html">run-script(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/install.html">install(1)</a></li></ul>
</div>
-<p id="footer">scripts — npm@1.1.15</p>
+<p id="footer">scripts — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/view.html">view(1)</a></li></ul>
</div>
-<p id="footer">search — npm@1.1.15</p>
+<p id="footer">search — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/json.html">json(1)</a></li></ul>
</div>
-<p id="footer">semver — npm@1.1.15</p>
+<p id="footer">semver — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/list.html">list(1)</a></li></ul>
</div>
-<p id="footer">shrinkwrap — npm@1.1.15</p>
+<p id="footer">shrinkwrap — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/view.html">view(1)</a></li><li><a href="../doc/whoami.html">whoami(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li></ul>
</div>
-<p id="footer">star — npm@1.1.15</p>
+<p id="footer">star — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/run-script.html">run-script(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/test.html">test(1)</a></li><li><a href="../doc/restart.html">restart(1)</a></li><li><a href="../doc/stop.html">stop(1)</a></li></ul>
</div>
-<p id="footer">start — npm@1.1.15</p>
+<p id="footer">start — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/run-script.html">run-script(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/test.html">test(1)</a></li><li><a href="../doc/start.html">start(1)</a></li><li><a href="../doc/restart.html">restart(1)</a></li></ul>
</div>
-<p id="footer">stop — npm@1.1.15</p>
+<p id="footer">stop — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/json.html">json(1)</a></li><li>git help submodule</li></ul>
</div>
-<p id="footer">submodule — npm@1.1.15</p>
+<p id="footer">submodule — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">tag — npm@1.1.15</p>
+<p id="footer">tag — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/run-script.html">run-script(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/start.html">start(1)</a></li><li><a href="../doc/restart.html">restart(1)</a></li><li><a href="../doc/stop.html">stop(1)</a></li></ul>
</div>
-<p id="footer">test — npm@1.1.15</p>
+<p id="footer">test — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/prune.html">prune(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">uninstall — npm@1.1.15</p>
+<p id="footer">uninstall — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/deprecate.html">deprecate(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../doc/owner.html">owner(1)</a></li></ul>
</div>
-<p id="footer">unpublish — npm@1.1.15</p>
+<p id="footer">unpublish — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/outdated.html">outdated(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/list.html">list(1)</a></li></ul>
</div>
-<p id="footer">update — npm@1.1.15</p>
+<p id="footer">update — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/init.html">init(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/semver.html">semver(1)</a></li></ul>
</div>
-<p id="footer">version — npm@1.1.15</p>
+<p id="footer">version — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/search.html">search(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/docs.html">docs(1)</a></li></ul>
</div>
-<p id="footer">view — npm@1.1.15</p>
+<p id="footer">view — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li></ul>
</div>
-<p id="footer">whoami — npm@1.1.15</p>
+<p id="footer">whoami — npm@1.1.18</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>npm is a package manager for <a href="http://nodejs.org/">node</a>. You can use it to install
and publish your node programs. It manages dependencies and does other cool stuff.</p>
-<h2>One Line Install</h2>
+<h2>Easy Zero Line Install</h2>
-<code>curl http://npmjs.org/install.sh | sh</code>
+<p><a href="http://nodejs.org/#download">Install Node.js</a> <br>
+(npm comes with it.)</p>
-<h2>More Than One Line Install</h2>
+<p>Because a one-line install is one too many.</p>
+
+<h2>Fancy Install</h2>
<ol>
<li><a href="https://github.com/isaacs/npm">Get the code.</a>
says to do.
</ol>
+<p>There's a pretty thorough install script at
+<a href="http://npmjs.org/install.sh">http://npmjs.org/install.sh</a></p>
+
+<p>For maximum security, make sure to thorougly inspect every
+program that you run on your computer!</p>
+
<h2>Other Cool Stuff</h2>
<ul>
}
if (repo) {
if (Array.isArray(repo)) repo = repo.shift()
- if (repo.url) repo = repo.url
+ if (repo.hasOwnProperty("url")) repo = repo.url
log.verbose(repo, "repository")
if (repo && repo.match(/^(https?:\/\/|git(:\/\/|@))github.com/)) {
return open(repo.replace(/^git(@|:\/\/)/, "http://")
if (homepage) return open(homepage, cb)
if (repo) {
if (Array.isArray(repo)) repo = repo.shift()
- if (repo.url) repo = repo.url
+ if (repo.hasOwnProperty("url")) repo = repo.url
log.verbose(repo, "repository")
if (repo) {
return open(repo.replace(/^git(@|:\/\/)/, 'http://')
, function (er, r) {
if (er) return cb(er)
if (r !== "none") {
- data.repository = (data.repository || {}).url = r
+ data.repository = (data.repository || {})
+ data.repository.url = r
+ } else {
+ delete data.repository
}
cb()
}
rv[key] = data[key]
})
rv.dependencies = {}
- Object.keys(newwrap.dependencies).forEach(function (key) {
+ Object.keys(newwrap.dependencies || {}).forEach(function (key) {
var w = newwrap.dependencies[key]
rv.dependencies[key] = w.from || w.version
})
// as dependencies to a package.json file.
// This is experimental.
function save (where, installed, tree, pretty, cb) {
- if (!npm.config.get("save") || npm.config.get("global")) {
+ if (!npm.config.get("save") &&
+ !npm.config.get("save-dev") &&
+ !npm.config.get("save-optional") ||
+ npm.config.get("global")) {
return cb(null, installed, tree, pretty)
}
} catch (ex) {
er = ex
}
- if (er) return cb(null, installed, tree, pretty)
+ if (er) {
+ return cb(null, installed, tree, pretty)
- var deps = npm.config.get("dev") ? "devDependencies" : "dependencies"
- deps = data[deps] = data[deps] || {}
+ }
+
+ var deps = npm.config.get("save-optional") ? "optionalDependencies"
+ : npm.config.get("save-dev") ? "devDependencies"
+ : "dependencies"
+ data[deps] = data[deps] || {}
Object.keys(things).forEach(function (t) {
- deps[t] = things[t]
+ data[deps][t] = things[t]
})
data = JSON.stringify(data, null, 2) + "\n"
fs.writeFile(saveTarget, data, function (er) {
, semver = require("semver")
, findPrefix = require("./utils/find-prefix.js")
, getUid = require("uid-number")
- , mkdir = require("mkdirp")
+ , mkdirp = require("mkdirp")
, slide = require("slide")
, chain = slide.chain
+// /usr/local is often a read-only fs, which is not
+// well handled by node or mkdirp. Just double-check
+// in the case of errors when making the prefix dirs.
+function mkdir (p, cb) {
+ mkdirp(p, function (er, made) {
+ // it could be that we couldn't create it, because it
+ // already exists, and is on a read-only fs.
+ if (er) {
+ return fs.stat(p, function (er2, st) {
+ if (er2 || !st.isDirectory()) return cb(er)
+ return cb(null, made)
+ })
+ }
+ return cb(er, made)
+ })
+}
+
npm.commands = {}
npm.ELIFECYCLE = {}
npm.E404 = {}
, os = require("os")
, nopt = require("nopt")
, log = require("./log.js")
+ , npm = require("../npm.js")
function Octal () {}
function validateOctal (data, k, val) {
, 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" : "npm/" + npm.version + " node/" + process.version
, "rebuild-bundle" : true
, registry : "http" + (httpsOk ? "s" : "") + "://registry.npmjs.org/"
, rollback : true
, save : false
+ , "save-dev" : false
+ , "save-optional" : false
, searchopts: ""
, searchexclude: null
, searchsort: "name"
, globalignorefile: path
, group : [Number, String]
, "https-proxy" : [null, url]
+ , "user-agent" : String
, ignore : String
, "init.version" : [null, semver]
, "init.author.name" : String
, registry : [null, url]
, rollback : Boolean
, save : Boolean
+ , "save-dev" : Boolean
+ , "save-optional" : Boolean
, searchopts : String
, searchexclude: [null, String]
, searchsort: [ "name", "-name"
, porcelain : ["--parseable"]
, g : ["--global"]
, S : ["--save"]
+ , D : ["--save-dev"]
+ , O : ["--save-optional"]
, y : ["--yes"]
, n : ["--no-yes"]
}
, proxy: proxy
, strictSSL: npm.config.get("strict-ssl")
, ca: remote.host === regHost ? npm.config.get("ca") : undefined
+ , headers: { "user-agent": npm.config.get("user-agent") }
, onResponse: onResponse }).pipe(fstr)
function onResponse (er, res) {
if (er) return fstr.emit("error", er)
headers.accept = "application/json"
+ headers["user-agent"] = npm.config.get("user-agent")
+
opts.proxy = npm.config.get( remote.protocol === "https:"
? "https-proxy" : "proxy" )
, semver = require("semver")
, readJson = require("./read-json.js")
, log = require("./log.js")
+ , url = require("url")
module.exports = readInstalled
continue
}
if ( typeof deps[d] === "string"
+ // url deps presumed innocent.
+ && !url.parse(deps[d]).protocol
&& !semver.satisfies(found.version, deps[d])) {
// the bad thing will happen
log.warn(obj.path + " requires "+d+"@'"+deps[d]
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM" "1" "March 2012" "" ""
+.TH "NPM" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm\fR \-\- node package manager
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-ADDUSER" "1" "March 2012" "" ""
+.TH "NPM\-ADDUSER" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-adduser\fR \-\- Add a registry user account
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-BIN" "1" "March 2012" "" ""
+.TH "NPM\-BIN" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-bin\fR \-\- Display npm bin folder
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-BUGS" "1" "March 2012" "" ""
+.TH "NPM\-BUGS" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-bugs\fR \-\- Bugs for a package in a web browser maybe
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-BUILD" "1" "March 2012" "" ""
+.TH "NPM\-BUILD" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-build\fR \-\- Build a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-BUNDLE" "1" "March 2012" "" ""
+.TH "NPM\-BUNDLE" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-bundle\fR \-\- REMOVED
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-CACHE" "1" "March 2012" "" ""
+.TH "NPM\-CACHE" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-cache\fR \-\- Manipulates packages cache
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-CHANGELOG" "1" "March 2012" "" ""
+.TH "NPM\-CHANGELOG" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-changelog\fR \-\- Changes
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-CODING\-STYLE" "1" "March 2012" "" ""
+.TH "NPM\-CODING\-STYLE" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-coding-style\fR \-\- npm\'s "funny" coding style
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-COMPLETION" "1" "March 2012" "" ""
+.TH "NPM\-COMPLETION" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-completion\fR \-\- Tab Completion for npm
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-CONFIG" "1" "March 2012" "" ""
+.TH "NPM\-CONFIG" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-config\fR \-\- Manage the npm configuration file
\fB\-S\fR: \fB\-\-save\fR
.
.IP "\(bu" 4
+\fB\-D\fR: \fB\-\-save\-dev\fR
+.
+.IP "\(bu" 4
+\fB\-O\fR: \fB\-\-save\-optional\fR
+.
+.IP "\(bu" 4
\fB\-y\fR: \fB\-\-yes\fR
.
.IP "\(bu" 4
.P
A proxy to use for outgoing https requests\.
.
+.SS "user\-agent"
+.
+.IP "\(bu" 4
+Default: npm/{npm\.version} node/{process\.version}
+.
+.IP "\(bu" 4
+Type: String
+.
+.IP "" 0
+.
+.P
+Sets a User\-Agent to the request header
+.
.SS "ignore"
.
.IP "\(bu" 4
.P
Only works if there is already a package\.json file present\.
.
+.SS "save\-dev"
+.
+.IP "\(bu" 4
+Default: false
+.
+.IP "\(bu" 4
+Type: Boolean
+.
+.IP "" 0
+.
+.P
+Save installed packages to a package\.json file as devDependencies\.
+.
+.P
+Only works if there is already a package\.json file present\.
+.
+.SS "save\-optional"
+.
+.IP "\(bu" 4
+Default: false
+.
+.IP "\(bu" 4
+Type: Boolean
+.
+.IP "" 0
+.
+.P
+Save installed packages to a package\.json file as optionalDependencies\.
+.
+.P
+Only works if there is already a package\.json file present\.
+.
.SS "searchopts"
.
.IP "\(bu" 4
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-DEPRECATE" "1" "March 2012" "" ""
+.TH "NPM\-DEPRECATE" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-deprecate\fR \-\- Deprecate a version of a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-DEVELOPERS" "1" "March 2012" "" ""
+.TH "NPM\-DEVELOPERS" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-developers\fR \-\- Developer Guide
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-DISPUTES" "1" "March 2012" "" ""
+.TH "NPM\-DISPUTES" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-disputes\fR \-\- Handling Module Name Disputes
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-DOCS" "1" "March 2012" "" ""
+.TH "NPM\-DOCS" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-docs\fR \-\- Docs for a package in a web browser maybe
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-EDIT" "1" "March 2012" "" ""
+.TH "NPM\-EDIT" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-edit\fR \-\- Edit an installed package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-EXPLORE" "1" "March 2012" "" ""
+.TH "NPM\-EXPLORE" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-explore\fR \-\- Browse an installed package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-FAQ" "1" "March 2012" "" ""
+.TH "NPM\-FAQ" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-faq\fR \-\- Frequently Asked Questions
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-FOLDERS" "1" "March 2012" "" ""
+.TH "NPM\-FOLDERS" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-folders\fR \-\- Folder Structures Used by npm
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-HELP\-SEARCH" "1" "March 2012" "" ""
+.TH "NPM\-HELP\-SEARCH" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-help-search\fR \-\- Search npm help documentation
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-HELP" "1" "March 2012" "" ""
+.TH "NPM\-HELP" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-help\fR \-\- Get help on npm
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-INDEX" "1" "March 2012" "" ""
+.TH "NPM\-INDEX" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-index\fR \-\- Index of all npm documentation
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-INIT" "1" "March 2012" "" ""
+.TH "NPM\-INIT" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-init\fR \-\- Interactively create a package\.json file
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-INSTALL" "1" "March 2012" "" ""
+.TH "NPM\-INSTALL" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-install\fR \-\- Install a package
npm install <tarball file>
npm install <tarball url>
npm install <folder>
-npm install <name>
+npm install <name> [\-\-save|\-\-save\-dev|\-\-save\-optional]
npm install <name>@<tag>
npm install <name>@<version>
npm install <name>@<version range>
+npm install <name>@<version range>
.
.fi
.
.
.IP "\(bu" 4
\fBnpm install\fR (in package directory, no arguments):
+.
+.IP
Install the dependencies in the local node_modules folder\.
.
.IP
.
.IP "\(bu" 4
\fBnpm install <folder>\fR:
+.
+.IP
Install a package that is sitting in a folder on the filesystem\.
.
.IP "\(bu" 4
\fBnpm install <tarball file>\fR:
+.
+.IP
Install a package that is sitting on the filesystem\. Note: if you just want
to link a dev directory into your npm root, you can do this more easily by
using \fBnpm link\fR\|\.
.IP "" 4
.
.nf
-npm install \./package\.tgz
+ npm install \./package\.tgz
.
.fi
.
.
.IP "\(bu" 4
\fBnpm install <tarball url>\fR:
+.
+.IP
Fetch the tarball url, and then install it\. In order to distinguish between
this and other options, the argument must start with "http://" or "https://"
.
.IP "" 4
.
.nf
-npm install https://github\.com/indexzero/forever/tarball/v0\.5\.6
+ npm install https://github\.com/indexzero/forever/tarball/v0\.5\.6
.
.fi
.
.
.IP "\(bu" 4
-\fBnpm install <name>\fR:
-Do a \fB<name>@<tag>\fR install, where \fB<tag>\fR is the "tag" config\. (See \fBnpm help config\fR)
+\fBnpm install <name> [\-\-save|\-\-save\-dev|\-\-save\-optional]\fR:
+.
+.IP
+Do a \fB<name>@<tag>\fR install, where \fB<tag>\fR is the "tag" config\. (See \fBnpm help config\fR\|\.)
+.
+.IP
+In most cases, this will install the latest version
+of the module published on npm\.
.
.IP
Example:
.
-.IP "" 4
+.IP
+ npm install sax
.
-.nf
-npm install sax
+.IP
+\fBnpm install\fR takes 3 exclusive, optional flags which save or update
+the package version in your main package\.json:
.
-.fi
+.IP "\(bu" 4
+\fB\-\-save\fR: Package will appear in your \fBdependencies\fR\|\.
.
-.IP "" 0
+.IP "\(bu" 4
+\fB\-\-save\-dev\fR: Package will appear in your \fBdevDependencies\fR\|\.
+.
+.IP "\(bu" 4
+\fB\-\-save\-optional\fR: Package will appear in your \fBoptionalDependencies\fR\|\.
+.
+.IP
+Examples:
+.
+.IP
+ npm install sax \-\-save
+ npm install node\-tap \-\-save\-dev
+ npm install dtrace\-provider \-\-save\-optional
.
.IP
\fBNote\fR: If there is a file or folder named \fB<name>\fR in the current
working directory, then it will try to install that, and only try to
fetch the package by name if it is not valid\.
.
+.IP "" 0
+
+.
.IP "\(bu" 4
\fBnpm install <name>@<tag>\fR:
+.
+.IP
Install the version of the package that is referenced by the specified tag\.
If the tag does not exist in the registry data for that package, then this
will fail\.
.IP "" 4
.
.nf
-npm install sax@latest
+ npm install sax@latest
.
.fi
.
.
.IP "\(bu" 4
\fBnpm install <name>@<version>\fR:
+.
+.IP
Install the specified version of the package\. This will fail if the version
has not been published to the registry\.
.
.IP "" 4
.
.nf
-npm install sax@0\.1\.1
+ npm install sax@0\.1\.1
.
.fi
.
.
.IP "\(bu" 4
\fBnpm install <name>@<version range>\fR:
+.
+.IP
Install a version of the package matching the specified version range\. This
will follow the same rules for resolving dependencies described in \fBnpm help json\fR\|\.
.
.IP
Example:
.
-.IP "" 4
-.
-.nf
-npm install sax@">=0\.1\.0 <0\.2\.0"
-.
-.fi
-.
-.IP "" 0
-
+.IP
+ npm install sax@">=0\.1\.0 <0\.2\.0"
.
.IP "\(bu" 4
\fBnpm install <git remote url>\fR:
Install a package by cloning a git remote url\. The format of the git
url is:
.
-.IP "" 4
-.
-.nf
-<protocol>://[<user>@]<hostname><separator><path>[#<commit\-ish>]
-.
-.fi
-.
-.IP "" 0
+.IP
+ <protocol>://[<user>@]<hostname><separator><path>[#<commit\-ish>]
.
.IP
\fB<protocol>\fR is one of \fBgit\fR, \fBgit+ssh\fR, \fBgit+http\fR, or \fBgit+https\fR\|\. If no \fB<commit\-ish>\fR is specified, then \fBmaster\fR is
.IP "" 4
.
.nf
-git+ssh://git@github\.com:isaacs/npm\.git#v1\.0\.27
-git+https://isaacs@github\.com/isaacs/npm\.git
-git://github\.com/isaacs/npm\.git#v1\.0\.27
+ git+ssh://git@github\.com:isaacs/npm\.git#v1\.0\.27
+ git+https://isaacs@github\.com/isaacs/npm\.git
+ git://github\.com/isaacs/npm\.git#v1\.0\.27
.
.fi
.
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-JSON" "1" "March 2012" "" ""
+.TH "NPM\-JSON" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-json\fR \-\- Specifics of npm\'s package\.json handling
.P
This is a way to prevent accidental publication of private repositories\.
If you would like to ensure that a given package is only ever published
-to a speciic registry (for example, an internal registry),
+to a specific registry (for example, an internal registry),
then use the \fBpublishConfig\fR hash described below
to override the \fBregistry\fR config param at publish\-time\.
.
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-LINK" "1" "March 2012" "" ""
+.TH "NPM\-LINK" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-link\fR \-\- Symlink a package folder
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-LS" "1" "March 2012" "" ""
+.TH "NPM\-LS" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-ls\fR \-\- List installed packages
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM" "1" "March 2012" "" ""
+.TH "NPM" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm\fR \-\- node package manager
.fi
.
.SH "VERSION"
-1.1.15
+1.1.18
.
.SH "DESCRIPTION"
npm is the package manager for the Node JavaScript platform\. It puts
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-OUTDATED" "1" "March 2012" "" ""
+.TH "NPM\-OUTDATED" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-outdated\fR \-\- Check for outdated packages
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-OWNER" "1" "March 2012" "" ""
+.TH "NPM\-OWNER" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-owner\fR \-\- Manage package owners
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PACK" "1" "March 2012" "" ""
+.TH "NPM\-PACK" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-pack\fR \-\- Create a tarball from a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PREFIX" "1" "March 2012" "" ""
+.TH "NPM\-PREFIX" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-prefix\fR \-\- Display prefix
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PRUNE" "1" "March 2012" "" ""
+.TH "NPM\-PRUNE" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-prune\fR \-\- Remove extraneous packages
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PUBLISH" "1" "March 2012" "" ""
+.TH "NPM\-PUBLISH" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-publish\fR \-\- Publish a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-REBUILD" "1" "March 2012" "" ""
+.TH "NPM\-REBUILD" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-rebuild\fR \-\- Rebuild a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-REGISTRY" "1" "March 2012" "" ""
+.TH "NPM\-REGISTRY" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-registry\fR \-\- The JavaScript Package Registry
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-REMOVAL" "1" "March 2012" "" ""
+.TH "NPM\-REMOVAL" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-removal\fR \-\- Cleaning the Slate
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-RESTART" "1" "March 2012" "" ""
+.TH "NPM\-RESTART" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-restart\fR \-\- Start a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-ROOT" "1" "March 2012" "" ""
+.TH "NPM\-ROOT" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-root\fR \-\- Display npm root
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-RUN\-SCRIPT" "1" "March 2012" "" ""
+.TH "NPM\-RUN\-SCRIPT" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-run-script\fR \-\- Run arbitrary package scripts
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SCRIPTS" "1" "March 2012" "" ""
+.TH "NPM\-SCRIPTS" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-scripts\fR \-\- How npm handles the "scripts" field
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SEARCH" "1" "March 2012" "" ""
+.TH "NPM\-SEARCH" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-search\fR \-\- Search for packages
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SEMVER" "1" "March 2012" "" ""
+.TH "NPM\-SEMVER" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-semver\fR \-\- The semantic versioner for npm
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SHRINKWRAP" "1" "March 2012" "" ""
+.TH "NPM\-SHRINKWRAP" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-shrinkwrap\fR \-\- Lock down dependency versions
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-STAR" "1" "March 2012" "" ""
+.TH "NPM\-STAR" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-star\fR \-\- Mark your favorite packages
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-START" "1" "March 2012" "" ""
+.TH "NPM\-START" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-start\fR \-\- Start a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-STOP" "1" "March 2012" "" ""
+.TH "NPM\-STOP" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-stop\fR \-\- Stop a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SUBMODULE" "1" "March 2012" "" ""
+.TH "NPM\-SUBMODULE" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-submodule\fR \-\- Add a package as a git submodule
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-TAG" "1" "March 2012" "" ""
+.TH "NPM\-TAG" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-tag\fR \-\- Tag a published version
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-TEST" "1" "March 2012" "" ""
+.TH "NPM\-TEST" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-test\fR \-\- Test a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-RM" "1" "March 2012" "" ""
+.TH "NPM\-RM" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-rm\fR \-\- Remove a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-UNPUBLISH" "1" "March 2012" "" ""
+.TH "NPM\-UNPUBLISH" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-unpublish\fR \-\- Remove a package from the registry
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-UPDATE" "1" "March 2012" "" ""
+.TH "NPM\-UPDATE" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-update\fR \-\- Update a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-VERSION" "1" "March 2012" "" ""
+.TH "NPM\-VERSION" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-version\fR \-\- Bump a package version
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-VIEW" "1" "March 2012" "" ""
+.TH "NPM\-VIEW" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-view\fR \-\- View registry info
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-WHOAMI" "1" "March 2012" "" ""
+.TH "NPM\-WHOAMI" "1" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-whoami\fR \-\- Display npm username
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-BIN" "3" "March 2012" "" ""
+.TH "NPM\-BIN" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-bin\fR \-\- Display npm bin folder
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-BUGS" "3" "March 2012" "" ""
+.TH "NPM\-BUGS" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-bugs\fR \-\- Bugs for a package in a web browser maybe
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-COMMANDS" "3" "March 2012" "" ""
+.TH "NPM\-COMMANDS" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-commands\fR \-\- npm commands
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-CONFIG" "3" "March 2012" "" ""
+.TH "NPM\-CONFIG" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-config\fR \-\- Manage the npm configuration files
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-DEPRECATE" "3" "March 2012" "" ""
+.TH "NPM\-DEPRECATE" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-deprecate\fR \-\- Deprecate a version of a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-DOCS" "3" "March 2012" "" ""
+.TH "NPM\-DOCS" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-docs\fR \-\- Docs for a package in a web browser maybe
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-EDIT" "3" "March 2012" "" ""
+.TH "NPM\-EDIT" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-edit\fR \-\- Edit an installed package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-EXPLORE" "3" "March 2012" "" ""
+.TH "NPM\-EXPLORE" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-explore\fR \-\- Browse an installed package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-HELP\-SEARCH" "3" "March 2012" "" ""
+.TH "NPM\-HELP\-SEARCH" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-help-search\fR \-\- Search the help pages
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "INIT" "3" "March 2012" "" ""
+.TH "INIT" "3" "April 2012" "" ""
.
.SH "NAME"
\fBinit\fR \-\- Interactively create a package\.json file
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-INSTALL" "3" "March 2012" "" ""
+.TH "NPM\-INSTALL" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-install\fR \-\- install a package programmatically
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-LINK" "3" "March 2012" "" ""
+.TH "NPM\-LINK" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-link\fR \-\- Symlink a package folder
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-LOAD" "3" "March 2012" "" ""
+.TH "NPM\-LOAD" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-load\fR \-\- Load config settings
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-LS" "3" "March 2012" "" ""
+.TH "NPM\-LS" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-ls\fR \-\- List installed packages
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM" "3" "March 2012" "" ""
+.TH "NPM" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm\fR \-\- node package manager
.fi
.
.SH "VERSION"
-1.1.15
+1.1.18
.
.SH "DESCRIPTION"
This is the API documentation for npm\.
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-OUTDATED" "3" "March 2012" "" ""
+.TH "NPM\-OUTDATED" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-outdated\fR \-\- Check for outdated packages
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-OWNER" "3" "March 2012" "" ""
+.TH "NPM\-OWNER" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-owner\fR \-\- Manage package owners
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PACK" "3" "March 2012" "" ""
+.TH "NPM\-PACK" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-pack\fR \-\- Create a tarball from a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PREFIX" "3" "March 2012" "" ""
+.TH "NPM\-PREFIX" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-prefix\fR \-\- Display prefix
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PRUNE" "3" "March 2012" "" ""
+.TH "NPM\-PRUNE" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-prune\fR \-\- Remove extraneous packages
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-PUBLISH" "3" "March 2012" "" ""
+.TH "NPM\-PUBLISH" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-publish\fR \-\- Publish a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-REBUILD" "3" "March 2012" "" ""
+.TH "NPM\-REBUILD" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-rebuild\fR \-\- Rebuild a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-RESTART" "3" "March 2012" "" ""
+.TH "NPM\-RESTART" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-restart\fR \-\- Start a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-ROOT" "3" "March 2012" "" ""
+.TH "NPM\-ROOT" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-root\fR \-\- Display npm root
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-RUN\-SCRIPT" "3" "March 2012" "" ""
+.TH "NPM\-RUN\-SCRIPT" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-run-script\fR \-\- Run arbitrary package scripts
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SEARCH" "3" "March 2012" "" ""
+.TH "NPM\-SEARCH" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-search\fR \-\- Search for packages
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SHRINKWRAP" "3" "March 2012" "" ""
+.TH "NPM\-SHRINKWRAP" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-shrinkwrap\fR \-\- programmatically generate package shrinkwrap file
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-START" "3" "March 2012" "" ""
+.TH "NPM\-START" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-start\fR \-\- Start a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-STOP" "3" "March 2012" "" ""
+.TH "NPM\-STOP" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-stop\fR \-\- Stop a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-SUBMODULE" "3" "March 2012" "" ""
+.TH "NPM\-SUBMODULE" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-submodule\fR \-\- Add a package as a git submodule
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-TAG" "3" "March 2012" "" ""
+.TH "NPM\-TAG" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-tag\fR \-\- Tag a published version
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-TEST" "3" "March 2012" "" ""
+.TH "NPM\-TEST" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-test\fR \-\- Test a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-UNINSTALL" "3" "March 2012" "" ""
+.TH "NPM\-UNINSTALL" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-uninstall\fR \-\- uninstall a package programmatically
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-UNPUBLISH" "3" "March 2012" "" ""
+.TH "NPM\-UNPUBLISH" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-unpublish\fR \-\- Remove a package from the registry
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-UPDATE" "3" "March 2012" "" ""
+.TH "NPM\-UPDATE" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-update\fR \-\- Update a package
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-VERSION" "3" "March 2012" "" ""
+.TH "NPM\-VERSION" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-version\fR \-\- Bump a package version
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-VIEW" "3" "March 2012" "" ""
+.TH "NPM\-VIEW" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-view\fR \-\- View registry info
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
-.TH "NPM\-WHOAMI" "3" "March 2012" "" ""
+.TH "NPM\-WHOAMI" "3" "April 2012" "" ""
.
.SH "NAME"
\fBnpm-whoami\fR \-\- Display npm username
return Ignore.prototype.readRules.call(this, buf, e)
}
- var p = this.package = JSON.parse(buf.toString())
+ buf = buf.toString().trim()
+
+ if (buf.length === 0) return []
+
+ try {
+ var p = this.package = JSON.parse(buf)
+ } catch (er) {
+ er.file = path.resolve(this.path, e)
+ this.error(er)
+ return
+ }
if (this === this.root) {
this.bundleLinks = this.bundleLinks || {}
}
// all *.gyp files are renamed to binding.gyp for node-gyp
- if (entry.basename.match(/\.gyp$/)) {
+ // but only when they are in the same folder as a package.json file.
+ if (entry.basename.match(/\.gyp$/) &&
+ this.entries.indexOf("package.json") !== -1) {
entry.basename = "binding.gyp"
entry.path = path.resolve(entry.dirname, entry.basename)
}
"node": "*"
},
"_engineSupported": true,
- "_npmVersion": "1.1.13",
- "_nodeVersion": "v0.7.7-pre",
+ "_npmVersion": "1.1.16",
+ "_nodeVersion": "v0.7.8-pre",
"_defaultsLoaded": true,
"_from": "fstream-ignore@~0.0.5"
}
},
"name": "fstream-npm",
"description": "fstream class for creating npm packages",
- "version": "0.0.4",
+ "version": "0.0.6",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/fstream-npm.git"
"name": "isaacs",
"email": "i@izs.me"
},
- "_id": "fstream-npm@0.0.4",
+ "_id": "fstream-npm@0.0.6",
"devDependencies": {},
"optionalDependencies": {},
"engines": {
"node": "*"
},
"_engineSupported": true,
- "_npmVersion": "1.1.13",
- "_nodeVersion": "v0.7.7-pre",
+ "_npmVersion": "1.1.16",
+ "_nodeVersion": "v0.7.8-pre",
"_defaultsLoaded": true,
- "_from": "fstream-npm@0 >=0.0.3"
+ "_from": "fstream-npm@0 >=0.0.5"
}
--- /dev/null
+(The MIT License)
+
+Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
, cursor = ansi(process.stderr)
/**
- * Process and execute the selected command.
+ * Process and execute the selected commands.
*/
var prog = gyp()
prog.parseArgv(process.argv)
+if (prog.todo.length === 0) {
+ return prog.usageAndExit()
+}
+
+
/**
* Set up logging handlers.
*/
cursor.write('\n')
})
+prog.on('warn', function () {
+ cursor.fg.yellow().bg.red().write('warn')
+ .fg.reset().bg.reset().write(' ')
+ .fg.grey().write(arguments[0])
+ .write(' ')
+ .reset()
+ for (var i=1, l=arguments.length; i<l; i++) {
+ cursor.write(arguments[i] + ' ')
+ }
+ cursor.write('\n')
+})
+
if (prog.opts.verbose) {
prog.on('verbose', function () {
cursor.fg.cyan().write('verb ')
.reset().write(inspect(args) + '\n')
})
+prog.info('it worked if it ends with', 'ok')
+
/**
- * Process and execute the selected command.
+ * Change dir if -C/--directory was passed.
*/
-if (!prog.command) {
- return prog.usageAndExit()
-}
-
-prog.info('it worked if it ends with', 'ok')
-
-if (typeof prog.commands[prog.command] != 'function') {
- cursor.fg.red().write('ERR! ')
- .fg.reset().write('Unknown command "' + prog.command + '"\n')
- cursor.fg.red().write('ERR! ')
- .fg.reset().write('not ok\n')
- process.exit(1)
+var dir = prog.opts.directory
+if (dir) {
+ var fs = require('fs')
+ try {
+ var stat = fs.statSync(dir)
+ if (stat.isDirectory()) {
+ prog.info('chdir:', dir)
+ process.chdir(dir)
+ } else {
+ prog.warn(dir + ' is not a directory')
+ }
+ } catch (e) {
+ prog.warn('directory:', e.message)
+ }
}
+// start running the given commands!
var completed = false
-prog.commands[prog.command](prog.argv, function (err) {
- completed = true
- if (err) {
- cursor.fg.red().write('ERR! ')
- .fg.reset().write(err.stack + '\n')
- cursor.fg.red().write('ERR! ')
- .fg.reset().write('not ok\n')
- return process.exit(1)
+run()
+
+function run () {
+ if (prog.todo.length === 0) {
+ // done!
+ completed = true
+ prog.info('done', 'ok')
+ return
}
- if (prog.command == 'list') {
- var versions = arguments[1]
- if (versions.length > 0) {
- versions.forEach(function (version) {
- console.log(version)
- })
- } else {
- prog.info('No node development files installed. Use `node-gyp install` to install a version.')
+ var command = prog.todo.shift()
+ prog.commands[command](prog.argv.slice(), function (err) {
+ if (err) {
+ cursor.fg.red().write('ERR! ')
+ .fg.reset().write(err.stack + '\n')
+ cursor.fg.red().write('ERR! ')
+ .fg.reset().write('not ok\n')
+ return process.exit(1)
}
- } else if (arguments.length >= 2) {
- console.log.apply(console, [].slice.call(arguments, 1))
- }
- prog.info('done', 'ok')
-})
+ if (command == 'list') {
+ var versions = arguments[1]
+ if (versions.length > 0) {
+ versions.forEach(function (version) {
+ console.log(version)
+ })
+ } else {
+ prog.info('No node development files installed. Use `node-gyp install` to install a version.')
+ }
+ } else if (arguments.length >= 2) {
+ console.log.apply(console, [].slice.call(arguments, 1))
+ }
+ process.nextTick(run)
+ })
+}
process.on('exit', function (code) {
if (!completed && !code) {
'GCC_VERSION': '4.2',
'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
'PREBINDING': 'NO', # No -Wl,-prebind
+ 'MACOSX_DEPLOYMENT_TARGET': '10.5',
'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [
'-fno-strict-aliasing',
* Module dependencies.
*/
-var fs = require('fs')
+var fs = require('graceful-fs')
, path = require('path')
, glob = require('glob')
, which = require('which')
- , asyncEmit = require('./util/asyncEmit')
- , createHook = require('./util/hook')
+ , mkdirp = require('./util/mkdirp')
, win = process.platform == 'win32'
exports.usage = 'Invokes `' + (win ? 'msbuild' : 'make') + '` and builds the module'
var command = win ? 'msbuild' : 'make'
, buildDir = path.resolve('build')
, configPath = path.resolve(buildDir, 'config.gypi')
+ , buildType
, config
- , emitter
+ , arch
+ , version
- createHook('gyp-build.js', function (err, _e) {
- if (err) return callback(err)
- emitter = _e
- loadConfigGypi()
- })
+ loadConfigGypi()
/**
* Load the "config.gypi" file that was generated during "configure".
return
}
config = JSON.parse(data.replace(/\#.+\n/, ''))
+
+ // get the 'arch', 'buildType', and 'version' vars from the config
+ buildType = config.target_defaults.default_configuration
+ arch = config.variables.target_arch
+ version = config.variables.target_version
+
+ if ('debug' in gyp.opts) {
+ buildType = gyp.opts.debug ? 'Debug' : 'Release'
+ }
+ if (!buildType) {
+ buildType = 'Release'
+ }
+
+ gyp.verbose('build type:', buildType)
+ gyp.verbose('architecture:', arch)
+ gyp.verbose('node version:', version)
+
if (win) {
findSolutionFile()
} else {
}
/**
- * On Windows, find first build/*.sln file.
+ * On Windows, find the first build/*.sln file.
*/
function findSolutionFile () {
})
}
+ /**
+ * Uses node-which to locate the msbuild / make executable.
+ */
+
function doWhich () {
// First make sure we have the build command in the PATH
which(command, function (err, execPath) {
return
}
gyp.verbose('`which` succeeded for `' + command + '`', execPath)
- build()
+ copyNodeLib()
})
}
return
}
command = msbuild
- build()
+ copyNodeLib()
})
}
/**
- * Actually spawn the process and compile the module.
+ * Copies the node.lib file for the current target architecture into the
+ * current proper dev dir location.
*/
- function build () {
- var buildType = config.target_defaults.default_configuration
- , platform = config.variables.target_arch == 'x64' ? '64' : '32'
+ function copyNodeLib () {
+ if (!win) return doBuild()
- if (gyp.opts.debug) {
- buildType = 'Debug'
- }
+ var devDir = path.resolve(gyp.devDir, version)
+ , buildDir = path.resolve(devDir, buildType)
+ , archNodeLibPath = path.resolve(devDir, arch, 'node.lib')
+ , buildNodeLibPath = path.resolve(buildDir, 'node.lib')
+
+ mkdirp(buildDir, function (err, isNew) {
+ if (err) return callback(err)
+ gyp.verbose('"' + buildType + '" dir needed to be created?', isNew)
+ var rs = fs.createReadStream(archNodeLibPath)
+ , ws = fs.createWriteStream(buildNodeLibPath)
+ rs.pipe(ws)
+ rs.on('error', callback)
+ ws.on('error', callback)
+ rs.on('end', doBuild)
+ })
+ }
+
+ /**
+ * Actually spawn the process and compile the module.
+ */
+
+ function doBuild () {
// Enable Verbose build
if (!win && gyp.opts.verbose) {
// Specify the build type, Release by default
if (win) {
- argv.push('/p:Configuration=' + buildType + ';Platform=Win' + platform)
+ var p = arch === 'x64' ? 'x64' : 'Win32'
+ argv.push('/p:Configuration=' + buildType + ';Platform=' + p)
} else {
argv.push('BUILDTYPE=' + buildType)
// Invoke the Makefile in the 'build' dir.
}
}
- asyncEmit(emitter, 'before', function (err) {
- if (err) return callback(err)
- var proc = gyp.spawn(command, argv)
- proc.on('exit', onExit)
- })
+ var proc = gyp.spawn(command, argv)
+ proc.on('exit', onExit)
}
/**
*/
function onExit (code, signal) {
- asyncEmit(emitter, 'after', function (err) {
- if (err) return callback(err)
- if (code !== 0) {
- return callback(new Error('`' + command + '` failed with exit code: ' + code))
- }
- if (signal) {
- return callback(new Error('`' + command + '` got signal: ' + signal))
- }
- callback()
- })
+ if (code !== 0) {
+ return callback(new Error('`' + command + '` failed with exit code: ' + code))
+ }
+ if (signal) {
+ return callback(new Error('`' + command + '` got signal: ' + signal))
+ }
+ callback()
}
}
*/
var rm = require('rimraf')
- , asyncEmit = require('./util/asyncEmit')
- , createHook = require('./util/hook')
function clean (gyp, argv, callback) {
// Remove the 'build' dir
var buildDir = 'build'
- , emitter
-
- createHook('gyp-clean.js', function (err, _e) {
- if (err) return callback(err)
- emitter = _e
- asyncEmit(emitter, 'before', function (err) {
- if (err) return callback(err)
- doClean()
- })
- })
-
- function doClean () {
- gyp.verbose('removing "build" directory')
- rm(buildDir, after)
- }
-
- function after () {
- asyncEmit(emitter, 'after', function (err) {
- if (err) return callback(err)
- callback()
- })
- }
+
+ gyp.verbose('removing "build" directory')
+ rm(buildDir, callback)
}
* Module dependencies.
*/
-var fs = require('fs')
+var fs = require('graceful-fs')
, path = require('path')
, glob = require('glob')
, which = require('which')
, semver = require('semver')
, mkdirp = require('./util/mkdirp')
- , createHook = require('./util/hook')
- , asyncEmit = require('./util/asyncEmit')
, win = process.platform == 'win32'
exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' for the current module'
function configure (gyp, argv, callback) {
- var python = gyp.opts.python || 'python'
+ var python = process.env.PYTHON || gyp.opts.python || 'python'
, buildDir = path.resolve('build')
, configPath
- , emitter
, versionStr
, version
- // Very first step is to load up the user-defined 'gyp-configure.js' file if it
- // exists. We relay filecycle events using the eventemitter returned from this
- createHook('gyp-configure.js', function (err, _e) {
- if (err) return callback(err)
- emitter = _e
- checkPython()
- })
+ checkPython()
// Make sure that Python is in the $PATH
function checkPython () {
return
}
gyp.verbose('`which` succeeded for `' + python + '`', execPath)
- getVersion()
+ getTargetVersion()
})
}
// We're gonna glob C:\python2*
function guessPython () {
gyp.verbose('could not find "' + python + '". guessing location')
- var rootDir = process.env.HOMEDIR || process.env.SystemDrive || 'C:\\'
+ var rootDir = process.env.HOMEDRIVE || process.env.SystemDrive || 'C:\\'
if (rootDir[rootDir.length - 1] !== '\\') {
rootDir += '\\'
}
return
}
python = pythonPath
- getVersion()
+ getTargetVersion()
})
}
function failNoPython () {
- callback(new Error('Python does not seem to be installed'))
+ callback(new Error('Can\'t find Python, you can set the PYTHON env variable.'))
}
- function getVersion () {
+ function getTargetVersion () {
+
+ // 'python' should be set by now
+ process.env.PYTHON = python
+
if (gyp.opts.target) {
// if --target was given, then ensure that version is installed
versionStr = gyp.opts.target
if (err) return callback(err)
gyp.verbose('creating build/config.gypi file')
- var config = {}
configPath = path.resolve(buildDir, 'config.gypi')
- config.target_defaults = {
- cflags: []
- , default_configuration: gyp.opts.debug ? 'Debug' : 'Release'
- , defines: []
- , include_dirs: []
- , libraries: []
+ var config = process.config || {}
+ , defaults = config.target_defaults
+ , variables = config.variables
+
+ if (!defaults) {
+ defaults = config.target_defaults = {}
+ }
+ if (!variables) {
+ variables = config.variables = {}
+ }
+ if (!defaults.cflags) {
+ defaults.cflags = []
+ }
+ if (!defaults.defines) {
+ defaults.defines = []
+ }
+ if (!defaults.include_dirs) {
+ defaults.include_dirs = []
+ }
+ if (!defaults.libraries) {
+ defaults.libraries = []
}
- config.variables = {
- target_arch: gyp.opts.arch || process.arch || 'ia32'
+ // set the default_configuration prop
+ if ('debug' in gyp.opts) {
+ defaults.default_configuration = gyp.opts.debug ? 'Debug' : 'Release'
+ }
+ if (!defaults.default_configuration) {
+ defaults.default_configuration = 'Release'
}
+ // set the target_arch variable
+ variables.target_arch = gyp.opts.arch || process.arch || 'ia32'
+
+ // also set the target_version variable
+ variables.target_version = version
+
+ // loop through the rest of the opts and add the unknown ones as variables.
+ // this allows for module-specific configure flags like:
+ //
+ // $ node-gyp configure --shared-libxml2
+ Object.keys(gyp.opts).forEach(function (opt) {
+ if (opt === 'argv') return
+ if (opt in gyp.configDefs) return
+ variables[opt.replace(/-/g, '_')] = gyp.opts[opt]
+ })
+
+ // ensures that any boolean values from `process.config` get stringified
+ function boolsToString (k, v) {
+ if (typeof v === 'boolean')
+ return String(v)
+ return v
+ }
+
+ // now write out the config.gypi file to the build/ dir
var prefix = '# Do not edit. File was generated by node-gyp\'s "configure" step'
- , json = JSON.stringify(config, null, 2)
+ , json = JSON.stringify(config, boolsToString, 2)
gyp.verbose('writing out config file', configPath)
fs.writeFile(configPath, [prefix, json, ''].join('\n'), runGypAddon)
}
function runGypAddon (err) {
if (err) return callback(err)
- var devDir = path.resolve(process.env.HOME, '.node-gyp', version)
- , gyp_addon = path.resolve(devDir, 'tools', 'gyp_addon')
+ // location of the `gyp_addon` python script for the target node version
+ var gyp_addon = path.resolve(gyp.devDir, version, 'tools', 'gyp_addon')
if (!~argv.indexOf('-f') && !~argv.indexOf('--format')) {
if (win) {
// execute `gyp_addon` from the current target node version
argv.unshift(gyp_addon)
- asyncEmit(emitter, 'before', function (err) {
- if (err) return callback(err)
-
- var cp = gyp.spawn(python, argv)
- cp.on('exit', onCpExit)
- })
+ var cp = gyp.spawn(python, argv)
+ cp.on('exit', onCpExit)
}
/**
*/
function onCpExit (code, signal) {
- asyncEmit(emitter, 'after', function (err) {
- if (err) {
- callback(err)
- } else if (code !== 0) {
- callback(new Error('`gyp_addon` failed with exit code: ' + code))
- } else {
- // we're done
- callback()
- }
- })
+ if (code !== 0) {
+ callback(new Error('`gyp_addon` failed with exit code: ' + code))
+ } else {
+ // we're done
+ callback()
+ }
}
}
* Module dependencies.
*/
-var fs = require('fs')
+var fs = require('graceful-fs')
, tar = require('tar')
, rm = require('rimraf')
, path = require('path')
, zlib = require('zlib')
- , mkdir = require('mkdirp')
, semver = require('semver')
, fstream = require('fstream')
, request = require('request')
, minimatch = require('minimatch')
+ , mkdir = require('./util/mkdirp')
, distUrl = 'http://nodejs.org/dist'
, win = process.platform == 'win32'
gyp.verbose('installing legacy version?', isLegacy)
if (semver.lt(versionStr, '0.6.0')) {
- return callback(new Error('Minimum target version is `0.6` or greater. Got: ' + versionStr))
+ return callback(new Error('Minimum target version is `0.6.0` or greater. Got: ' + versionStr))
}
// 0.x.y-pre versions are not published yet. Use previous release.
version = version.slice(1, 4).join('.')
gyp.verbose('installing version', version)
+ // the directory where the dev files will be installed
+ var devDir = path.resolve(gyp.devDir, version)
- // TODO: Make ~/.node-gyp configurable
- var devDir = path.resolve(process.env.HOME, '.node-gyp', version)
-
- // If '--ensure' was passed, then don't *always* install the version,
+ // If '--ensure' was passed, then don't *always* install the version;
// check if it is already installed, and only install when needed
if (gyp.opts.ensure) {
gyp.verbose('--ensure was passed, so won\'t reinstall if already installed')
go()
}
- function download(url,onError) {
+ function download (url, onError) {
gyp.info('downloading:', url)
var requestOpts = {
uri: url
function go () {
// first create the dir for the node dev files
- mkdir(devDir, function (err) {
+ mkdir(devDir, function (err, created) {
if (err) return cb(err)
- // TODO: Detect if it was actually created or if it already existed
- gyp.verbose('created:', devDir)
+ if (created) {
+ gyp.verbose('created:', devDir)
+ } else {
+ gyp.verbose('directory already existed:', devDir)
+ }
// now download the node tarball
var tarballUrl = distUrl + '/v' + version + '/node-v' + version + '.tar.gz'
function downloadNodeLib (done) {
gyp.verbose('on Windows; need to download `node.lib`...')
- // TODO: windows 64-bit support
- var releaseDir = path.resolve(devDir, 'Release')
- , debugDir = path.resolve(devDir, 'Debug')
- , nodeLibUrl = distUrl + '/v' + version + '/node.lib'
-
- gyp.verbose('Release dir', releaseDir)
- gyp.verbose('Debug dir', debugDir)
- gyp.verbose('`node.lib` url', nodeLibUrl)
- // TODO: parallelize mkdirs
- mkdir(releaseDir, function (err) {
+ var dir32 = path.resolve(devDir, 'ia32')
+ , dir64 = path.resolve(devDir, 'x64')
+ , nodeLibPath32 = path.resolve(dir32, 'node.lib')
+ , nodeLibPath64 = path.resolve(dir64, 'node.lib')
+ , nodeLibUrl32 = distUrl + '/v' + version + '/node.lib'
+ , nodeLibUrl64 = distUrl + '/v' + version + '/x64/node.lib'
+
+ gyp.verbose('32-bit node.lib dir', dir32)
+ gyp.verbose('64-bit node.lib dir', dir64)
+ gyp.verbose('`node.lib` 32-bit url', nodeLibUrl32)
+ gyp.verbose('`node.lib` 64-bit url', nodeLibUrl64)
+
+ var async = 2
+ mkdir(dir32, function (err) {
+ if (err) return done(err)
+ gyp.verbose('streaming 32-bit node.lib to:', nodeLibPath32)
+
+ var req = download(nodeLibUrl32)
+ req.on('error', done)
+ req.on('response', function (res) {
+ if (res.statusCode !== 200) {
+ done(new Error(res.statusCode + ' status code downloading 32-bit node.lib'))
+ }
+ })
+ req.on('end', function () {
+ --async || done()
+ })
+
+ var ws = fs.createWriteStream(nodeLibPath32)
+ ws.on('error', cb)
+ req.pipe(ws)
+ })
+ mkdir(dir64, function (err) {
if (err) return done(err)
- mkdir(debugDir, function (err) {
- if (err) return done(err)
- // TODO: clean this mess up, written in a hastemode-9000
- var badDownload = false
- var res = download(nodeLibUrl, function (err, res) {
- if (err || res.statusCode != 200) {
- badDownload = true
- done(err || new Error(res.statusCode + ' status code downloading node.lib'))
- }
- })
- var releaseDirNodeLib = path.resolve(releaseDir, 'node.lib')
- , debugDirNodeLib = path.resolve(debugDir, 'node.lib')
- , rws = fs.createWriteStream(releaseDirNodeLib)
- , dws = fs.createWriteStream(debugDirNodeLib)
- gyp.verbose('streaming to', releaseDirNodeLib)
- gyp.verbose('streaming to', debugDirNodeLib)
- res.pipe(rws)
- res.pipe(dws)
- res.on('end', function () {
- if (badDownload) return
- done()
- })
+ gyp.verbose('streaming 64-bit node.lib to:', nodeLibPath64)
+
+ var req = download(nodeLibUrl64)
+ req.on('error', done)
+ req.on('response', function (res) {
+ if (res.statusCode !== 200) {
+ done(new Error(res.statusCode + ' status code downloading 64-bit node.lib'))
+ }
})
+ req.on('end', function () {
+ --async || done()
+ })
+
+ var ws = fs.createWriteStream(nodeLibPath64)
+ ws.on('error', cb)
+ req.pipe(ws)
})
}
* Module dependencies.
*/
-var fs = require('fs')
+var fs = require('graceful-fs')
, path = require('path')
function list (gyp, args, callback) {
- // TODO: Make ~/.node-gyp configurable
- var nodeGypDir = path.resolve(process.env.HOME, '.node-gyp')
-
- gyp.verbose('using node-gyp dir', nodeGypDir)
+ gyp.verbose('using node-gyp dir', gyp.devDir)
// readdir the node-gyp dir
- fs.readdir(nodeGypDir, onreaddir)
+ fs.readdir(gyp.devDir, onreaddir)
function onreaddir (err, versions) {
if (err && err.code != 'ENOENT') {
* Module dependencies.
*/
-var fs = require('fs')
+var fs = require('graceful-fs')
, path = require('path')
, nopt = require('nopt')
, child_process = require('child_process')
function Gyp () {
var me = this
+ // set the dir where node-gyp dev files get installed
+ // TODO: make this configurable?
+ // see: https://github.com/TooTallNate/node-gyp/issues/21
+ var homeDir = process.env.HOME || process.env.USERPROFILE
+ this.devDir = path.resolve(homeDir, '.node-gyp')
+
this.commands = {}
+
commands.forEach(function (command) {
me.commands[command] = function (argv, callback) {
me.verbose('command', command, argv)
return require('./' + command)(me, argv, callback)
}
})
+
+ Object.keys(aliases).forEach(function (alias) {
+ me.commands[alias] = me.commands[aliases[alias]]
+ })
}
inherits(Gyp, EE)
exports.Gyp = Gyp
proto.package = require('../package')
+/**
+ * nopt configuration definitions
+ */
+
proto.configDefs = {
help: Boolean // everywhere
, arch: String // 'configure'
+ , directory: String // bin
, msvs_version: String // 'configure'
, debug: Boolean // 'build'
, ensure: Boolean // 'install'
, proxy: String // 'install'
}
-proto.shorthands = {}
+/**
+ * nopt shorthands
+ */
+
+proto.shorthands = {
+ release: '--no-debug'
+ , C: '--directory'
+}
+
+/**
+ * Parses the given argv array and sets the 'opts',
+ * 'argv' and 'command' properties.
+ */
proto.parseArgv = function parseOpts (argv) {
this.opts = nopt(this.configDefs, this.shorthands, argv)
this.argv = this.opts.argv.remain.slice()
- var command = this.argv.shift()
- this.command = aliases[command] || command
+ var commands = []
+ this.argv.slice().forEach(function (arg) {
+ if (arg in this.commands) {
+ this.argv.splice(this.argv.indexOf(arg), 1)
+ commands.push(arg)
+ }
+ }, this)
+
+ this.todo = commands
}
/**
args.unshift('info')
this.emit.apply(this, args)
}
+proto.warn = function warn () {
+ var args = Array.prototype.slice.call(arguments)
+ args.unshift('warn')
+ this.emit.apply(this, args)
+}
proto.verbose = function verbose () {
var args = Array.prototype.slice.call(arguments)
function remove (gyp, argv, callback) {
- // TODO: Make ~/.node-gyp configurable
- var nodeGypDir = path.resolve(process.env.HOME, '.node-gyp')
-
- gyp.verbose('using node-gyp dir', nodeGypDir)
+ gyp.verbose('using node-gyp dir', gyp.devDir)
// get the user-specified version to remove
var v = argv[0] || gyp.opts.target
// flatten the version Array into a String
version = version.slice(1, 4).join('.')
- var versionPath = path.resolve(nodeGypDir, version)
+ var versionPath = path.resolve(gyp.devDir, version)
gyp.verbose('removing development files for version', version)
// first check if its even installed
+++ /dev/null
-
-/**
- * An `asyncEmit()` function that accepts an EventEmitter, an Array of args, and
- * a callback function. If the emitter listener function has an arity
- * > args.length then there is an assumed callback function on the emitter, which
- * means that it is doing some async work. We have to wait for the callbacks for
- * any async listener functions.
- *
- * It works like this:
- *
- * var emitter = new EventEmitter
- *
- * // this is an async listener
- * emitter.on('something', function (val, done) {
- * // val may be any number of input arguments
- * setTimeout(function () {
- * done()
- * }, 1000)
- * })
- *
- * // this is a sync listener, no callback function
- * emitter.on('something', function (val) {
- *
- * })
- *
- * asyncEmit(emitter, 'something', [ 5 ], function (err) {
- * if (err) throw err
- * console.log('DONE!')
- * })
- */
-
-module.exports = asyncEmit
-function asyncEmit (emitter, eventName, args, callback) {
-
- if (typeof args == 'function') {
- callback = args
- args = []
- }
-
- var async = emitter.listeners(eventName).filter(function (func) {
- return func.length > args.length
- }).length
-
- var argv = [ eventName ].concat(args)
-
- // callback function
- argv.push(function (err) {
- if (err && !callback.called) {
- callback.called = true
- callback(err)
- }
- --async || callback()
- })
-
- // no async listeners
- if (async === 0) {
- process.nextTick(callback)
- }
-
- return emitter.emit.apply(emitter, argv)
-}
+++ /dev/null
-
-/**
- * This is our "Hook" class that allows a script to hook into the lifecyle of the
- * "configure", "build" and "clean" commands. It's basically a hack into the
- * module.js file to allow custom hooks into the module-space, specifically to
- * make the global scope act as an EventEmitter.
- */
-
-var fs = require('fs')
- , path = require('path')
- , Module = require('module')
- , EventEmitter = require('events').EventEmitter
- , functions = Object.keys(EventEmitter.prototype).filter(function (k) {
- return typeof EventEmitter.prototype[k] == 'function'
- })
- , boilerplate = functions.map(function (k) {
- return 'var ' + k + ' = module.emitter.' + k + '.bind(module.emitter);'
- }).join('')
-
-module.exports = createHook
-function createHook (filename, callback) {
-
- var emitter = new EventEmitter
-
- // first read the file contents
- fs.readFile(filename, 'utf8', function (err, code) {
- if (err) {
- if (err.code == 'ENOENT') {
- // hook file doesn't exist, oh well
- callback(null, emitter)
- } else {
- callback(err)
- }
- return
- }
- // got a hook file, now execute it
- var mod = new Module(filename)
- mod.filename = filename
- mod.paths = Module._nodeModulePaths(filename)
- mod.emitter = emitter
- try {
- mod._compile(boilerplate + code, filename)
- } catch (e) {
- return callback(e)
- }
- callback(null, emitter)
- })
-}
"dependencies": {},
"optionalDependencies": {},
"_engineSupported": true,
- "_npmVersion": "1.1.13",
- "_nodeVersion": "v0.7.7-pre",
+ "_npmVersion": "1.1.16",
+ "_nodeVersion": "v0.7.8-pre",
"_defaultsLoaded": true,
"_from": "ansi@0.0.x"
}
"_id": "glob@3.1.9",
"optionalDependencies": {},
"_engineSupported": true,
- "_npmVersion": "1.1.13",
- "_nodeVersion": "v0.7.7-pre",
+ "_npmVersion": "1.1.16",
+ "_nodeVersion": "v0.7.8-pre",
"_defaultsLoaded": true,
"_from": "glob@3"
}
"bindings",
"gyp"
],
- "version": "0.3.9",
- "installVersion": 5,
+ "version": "0.4.1",
+ "installVersion": 7,
"author": {
"name": "Nathan Rajlich",
"email": "nathan@tootallnate.net",
"name": "isaacs",
"email": "i@izs.me"
},
- "_id": "node-gyp@0.3.9",
+ "_id": "node-gyp@0.4.1",
"devDependencies": {},
"optionalDependencies": {},
"_engineSupported": true,
- "_npmVersion": "1.1.13",
- "_nodeVersion": "v0.7.7-pre",
+ "_npmVersion": "1.1.16",
+ "_nodeVersion": "v0.7.8-pre",
"_defaultsLoaded": true,
"dist": {
- "shasum": "78c01d4b662c55607e7220b8c8e2a1f25390474a"
+ "shasum": "05a017b115527b63fdec1321d0b5888bc5d7b04f"
},
- "_from": "node-gyp@~0.3.7"
+ "_from": "node-gyp@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.
, tty = require("tty")
, StringDecoder = require("string_decoder").StringDecoder
+function raw (mode) {
+ try {
+ process.stdin.setRawMode(mode)
+ } catch (e) {
+ tty.setRawMode(mode)
+ }
+}
+
function read (opts, cb) {
if (!cb) cb = opts, opts = {}
cb = (function (cb) {
var called = false
var t = setTimeout(function () {
- tty.setRawMode(false)
+ raw(false)
process.stdout.write("\n")
if (def) done(null, def)
else done(new Error("timeout"))
, val = ""
, decoder = new StringDecoder
- tty.setRawMode(true)
+ raw(true)
stdin.resume()
stdin.on("error", cb)
stdin.on("data", function D (c) {
case "\u0004": // EOF
case delim:
- tty.setRawMode(false)
+ raw(false)
stdin.removeListener("data", D)
stdin.removeListener("error", cb)
val = val.trim() || def
return cb(null, val)
case "\u0003": case "\0": // ^C or other signal abort
- tty.setRawMode(false)
+ raw(false)
stdin.removeListener("data", D)
stdin.removeListener("error", cb)
stdin.pause()
{
"name": "read",
- "version": "0.0.1",
+ "version": "0.0.2",
"main": "lib/read.js",
"dependencies": {},
"devDependencies": {},
"engines": {
"node": ">=0.6"
},
- "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me/"
+ },
"description": "read(1) for node programs",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/read.git"
- }
+ },
+ "license": "BSD",
+ "_id": "read@0.0.2",
+ "optionalDependencies": {},
+ "_engineSupported": true,
+ "_npmVersion": "1.1.15",
+ "_nodeVersion": "v0.7.7",
+ "_defaultsLoaded": true,
+ "_from": "read@0"
}
"install",
"package.json"
],
- "version": "1.1.15",
+ "version": "1.1.18",
"preferGlobal": true,
"config": {
"publishtest": false
"mkdirp": "0.3",
"read": "0",
"lru-cache": "1",
- "node-gyp": "~0.3.7",
- "fstream-npm": "0 >=0.0.4",
+ "node-gyp": "~0.4.1",
+ "fstream-npm": "0 >=0.0.5",
"uid-number": "0",
"archy": "0",
"chownr": "0"
"block-stream",
"inherits",
"mkdirp",
- "fast-list",
"read",
"lru-cache",
"node-gyp",
function done (which) { return function (er, docs) {
if (er) throw er
+ docs.sort()
if (which === "api") apidocs = docs
else clidocs = docs