diff options
Diffstat (limited to 'deps/npm/html/doc/misc')
-rw-r--r-- | deps/npm/html/doc/misc/index.html | 438 | ||||
-rw-r--r-- | deps/npm/html/doc/misc/npm-coding-style.html | 216 | ||||
-rw-r--r-- | deps/npm/html/doc/misc/npm-config.html | 751 | ||||
-rw-r--r-- | deps/npm/html/doc/misc/npm-developers.html | 208 | ||||
-rw-r--r-- | deps/npm/html/doc/misc/npm-disputes.html | 125 | ||||
-rw-r--r-- | deps/npm/html/doc/misc/npm-faq.html | 374 | ||||
-rw-r--r-- | deps/npm/html/doc/misc/npm-index.html | 442 | ||||
-rw-r--r-- | deps/npm/html/doc/misc/npm-registry.html | 130 | ||||
-rw-r--r-- | deps/npm/html/doc/misc/npm-scripts.html | 257 | ||||
-rw-r--r-- | deps/npm/html/doc/misc/removing-npm.html | 92 | ||||
-rw-r--r-- | deps/npm/html/doc/misc/semver.html | 128 |
11 files changed, 3161 insertions, 0 deletions
diff --git a/deps/npm/html/doc/misc/index.html b/deps/npm/html/doc/misc/index.html new file mode 100644 index 0000000000..4db393c7c4 --- /dev/null +++ b/deps/npm/html/doc/misc/index.html @@ -0,0 +1,438 @@ +<!doctype html> +<html> + <title>index</title> + <meta http-equiv="content-type" value="text/html;utf-8"> + <link rel="stylesheet" type="text/css" href="../../static/style.css"> + + <body> + <div id="wrapper"> +<h1><a href="../misc/npm-index.html">npm-index</a></h1> <p>Index of all npm documentation</p> + +<h2 id="README-1"><a href="../../doc/README.html">README</a></h2> + +<p>node package manager</p> + +<h1>Command Line Documentation</h1> + +<h2 id="npm-1"><a href="../cli/npm.html">npm(1)</a></h2> + +<p>node package manager</p> + +<h2 id="npm-adduser-1"><a href="../cli/npm-adduser.html">npm-adduser(1)</a></h2> + +<p>Add a registry user account</p> + +<h2 id="npm-bin-1"><a href="../cli/npm-bin.html">npm-bin(1)</a></h2> + +<p>Display npm bin folder</p> + +<h2 id="npm-bugs-1"><a href="../cli/npm-bugs.html">npm-bugs(1)</a></h2> + +<p>Bugs for a package in a web browser maybe</p> + +<h2 id="npm-build-1"><a href="../cli/npm-build.html">npm-build(1)</a></h2> + +<p>Build a package</p> + +<h2 id="npm-bundle-1"><a href="../cli/npm-bundle.html">npm-bundle(1)</a></h2> + +<p>REMOVED</p> + +<h2 id="npm-cache-1"><a href="../cli/npm-cache.html">npm-cache(1)</a></h2> + +<p>Manipulates packages cache</p> + +<h2 id="npm-completion-1"><a href="../cli/npm-completion.html">npm-completion(1)</a></h2> + +<p>Tab Completion for npm</p> + +<h2 id="npm-config-1"><a href="../cli/npm-config.html">npm-config(1)</a></h2> + +<p>Manage the npm configuration files</p> + +<h2 id="npm-dedupe-1"><a href="../cli/npm-dedupe.html">npm-dedupe(1)</a></h2> + +<p>Reduce duplication</p> + +<h2 id="npm-deprecate-1"><a href="../cli/npm-deprecate.html">npm-deprecate(1)</a></h2> + +<p>Deprecate a version of a package</p> + +<h2 id="npm-docs-1"><a href="../cli/npm-docs.html">npm-docs(1)</a></h2> + +<p>Docs for a package in a web browser maybe</p> + +<h2 id="npm-edit-1"><a href="../cli/npm-edit.html">npm-edit(1)</a></h2> + +<p>Edit an installed package</p> + +<h2 id="npm-explore-1"><a href="../cli/npm-explore.html">npm-explore(1)</a></h2> + +<p>Browse an installed package</p> + +<h2 id="npm-help-search-1"><a href="../cli/npm-help-search.html">npm-help-search(1)</a></h2> + +<p>Search npm help documentation</p> + +<h2 id="npm-help-1"><a href="../cli/npm-help.html">npm-help(1)</a></h2> + +<p>Get help on npm</p> + +<h2 id="npm-init-1"><a href="../cli/npm-init.html">npm-init(1)</a></h2> + +<p>Interactively create a package.json file</p> + +<h2 id="npm-install-1"><a href="../cli/npm-install.html">npm-install(1)</a></h2> + +<p>Install a package</p> + +<h2 id="npm-link-1"><a href="../cli/npm-link.html">npm-link(1)</a></h2> + +<p>Symlink a package folder</p> + +<h2 id="npm-ls-1"><a href="../cli/npm-ls.html">npm-ls(1)</a></h2> + +<p>List installed packages</p> + +<h2 id="npm-outdated-1"><a href="../cli/npm-outdated.html">npm-outdated(1)</a></h2> + +<p>Check for outdated packages</p> + +<h2 id="npm-owner-1"><a href="../cli/npm-owner.html">npm-owner(1)</a></h2> + +<p>Manage package owners</p> + +<h2 id="npm-pack-1"><a href="../cli/npm-pack.html">npm-pack(1)</a></h2> + +<p>Create a tarball from a package</p> + +<h2 id="npm-prefix-1"><a href="../cli/npm-prefix.html">npm-prefix(1)</a></h2> + +<p>Display prefix</p> + +<h2 id="npm-prune-1"><a href="../cli/npm-prune.html">npm-prune(1)</a></h2> + +<p>Remove extraneous packages</p> + +<h2 id="npm-publish-1"><a href="../cli/npm-publish.html">npm-publish(1)</a></h2> + +<p>Publish a package</p> + +<h2 id="npm-rebuild-1"><a href="../cli/npm-rebuild.html">npm-rebuild(1)</a></h2> + +<p>Rebuild a package</p> + +<h2 id="npm-restart-1"><a href="../cli/npm-restart.html">npm-restart(1)</a></h2> + +<p>Start a package</p> + +<h2 id="npm-rm-1"><a href="../cli/npm-rm.html">npm-rm(1)</a></h2> + +<p>Remove a package</p> + +<h2 id="npm-root-1"><a href="../cli/npm-root.html">npm-root(1)</a></h2> + +<p>Display npm root</p> + +<h2 id="npm-run-script-1"><a href="../cli/npm-run-script.html">npm-run-script(1)</a></h2> + +<p>Run arbitrary package scripts</p> + +<h2 id="npm-search-1"><a href="../cli/npm-search.html">npm-search(1)</a></h2> + +<p>Search for packages</p> + +<h2 id="npm-shrinkwrap-1"><a href="../cli/npm-shrinkwrap.html">npm-shrinkwrap(1)</a></h2> + +<p>Lock down dependency versions</p> + +<h2 id="npm-star-1"><a href="../cli/npm-star.html">npm-star(1)</a></h2> + +<p>Mark your favorite packages</p> + +<h2 id="npm-stars-1"><a href="../cli/npm-stars.html">npm-stars(1)</a></h2> + +<p>View packages marked as favorites</p> + +<h2 id="npm-start-1"><a href="../cli/npm-start.html">npm-start(1)</a></h2> + +<p>Start a package</p> + +<h2 id="npm-stop-1"><a href="../cli/npm-stop.html">npm-stop(1)</a></h2> + +<p>Stop a package</p> + +<h2 id="npm-submodule-1"><a href="../cli/npm-submodule.html">npm-submodule(1)</a></h2> + +<p>Add a package as a git submodule</p> + +<h2 id="npm-tag-1"><a href="../cli/npm-tag.html">npm-tag(1)</a></h2> + +<p>Tag a published version</p> + +<h2 id="npm-test-1"><a href="../cli/npm-test.html">npm-test(1)</a></h2> + +<p>Test a package</p> + +<h2 id="npm-uninstall-1"><a href="../cli/npm-uninstall.html">npm-uninstall(1)</a></h2> + +<p>Remove a package</p> + +<h2 id="npm-unpublish-1"><a href="../cli/npm-unpublish.html">npm-unpublish(1)</a></h2> + +<p>Remove a package from the registry</p> + +<h2 id="npm-update-1"><a href="../cli/npm-update.html">npm-update(1)</a></h2> + +<p>Update a package</p> + +<h2 id="npm-version-1"><a href="../cli/npm-version.html">npm-version(1)</a></h2> + +<p>Bump a package version</p> + +<h2 id="npm-view-1"><a href="../cli/npm-view.html">npm-view(1)</a></h2> + +<p>View registry info</p> + +<h2 id="npm-whoami-1"><a href="../cli/npm-whoami.html">npm-whoami(1)</a></h2> + +<p>Display npm username</p> + +<h1>API Documentation</h1> + +<h2 id="npm-3"><a href="../api/npm.html">npm(3)</a></h2> + +<p>node package manager</p> + +<h2 id="npm-bin-3"><a href="../api/npm-bin.html">npm-bin(3)</a></h2> + +<p>Display npm bin folder</p> + +<h2 id="npm-bugs-3"><a href="../api/npm-bugs.html">npm-bugs(3)</a></h2> + +<p>Bugs for a package in a web browser maybe</p> + +<h2 id="npm-commands-3"><a href="../api/npm-commands.html">npm-commands(3)</a></h2> + +<p>npm commands</p> + +<h2 id="npm-config-3"><a href="../api/npm-config.html">npm-config(3)</a></h2> + +<p>Manage the npm configuration files</p> + +<h2 id="npm-deprecate-3"><a href="../api/npm-deprecate.html">npm-deprecate(3)</a></h2> + +<p>Deprecate a version of a package</p> + +<h2 id="npm-docs-3"><a href="../api/npm-docs.html">npm-docs(3)</a></h2> + +<p>Docs for a package in a web browser maybe</p> + +<h2 id="npm-edit-3"><a href="../api/npm-edit.html">npm-edit(3)</a></h2> + +<p>Edit an installed package</p> + +<h2 id="npm-explore-3"><a href="../api/npm-explore.html">npm-explore(3)</a></h2> + +<p>Browse an installed package</p> + +<h2 id="npm-help-search-3"><a href="../api/npm-help-search.html">npm-help-search(3)</a></h2> + +<p>Search the help pages</p> + +<h2 id="npm-init-3"><a href="../api/npm-init.html">npm-init(3)</a></h2> + +<p>Interactively create a package.json file</p> + +<h2 id="npm-install-3"><a href="../api/npm-install.html">npm-install(3)</a></h2> + +<p>install a package programmatically</p> + +<h2 id="npm-link-3"><a href="../api/npm-link.html">npm-link(3)</a></h2> + +<p>Symlink a package folder</p> + +<h2 id="npm-load-3"><a href="../api/npm-load.html">npm-load(3)</a></h2> + +<p>Load config settings</p> + +<h2 id="npm-ls-3"><a href="../api/npm-ls.html">npm-ls(3)</a></h2> + +<p>List installed packages</p> + +<h2 id="npm-outdated-3"><a href="../api/npm-outdated.html">npm-outdated(3)</a></h2> + +<p>Check for outdated packages</p> + +<h2 id="npm-owner-3"><a href="../api/npm-owner.html">npm-owner(3)</a></h2> + +<p>Manage package owners</p> + +<h2 id="npm-pack-3"><a href="../api/npm-pack.html">npm-pack(3)</a></h2> + +<p>Create a tarball from a package</p> + +<h2 id="npm-prefix-3"><a href="../api/npm-prefix.html">npm-prefix(3)</a></h2> + +<p>Display prefix</p> + +<h2 id="npm-prune-3"><a href="../api/npm-prune.html">npm-prune(3)</a></h2> + +<p>Remove extraneous packages</p> + +<h2 id="npm-publish-3"><a href="../api/npm-publish.html">npm-publish(3)</a></h2> + +<p>Publish a package</p> + +<h2 id="npm-rebuild-3"><a href="../api/npm-rebuild.html">npm-rebuild(3)</a></h2> + +<p>Rebuild a package</p> + +<h2 id="npm-restart-3"><a href="../api/npm-restart.html">npm-restart(3)</a></h2> + +<p>Start a package</p> + +<h2 id="npm-root-3"><a href="../api/npm-root.html">npm-root(3)</a></h2> + +<p>Display npm root</p> + +<h2 id="npm-run-script-3"><a href="../api/npm-run-script.html">npm-run-script(3)</a></h2> + +<p>Run arbitrary package scripts</p> + +<h2 id="npm-search-3"><a href="../api/npm-search.html">npm-search(3)</a></h2> + +<p>Search for packages</p> + +<h2 id="npm-shrinkwrap-3"><a href="../api/npm-shrinkwrap.html">npm-shrinkwrap(3)</a></h2> + +<p>programmatically generate package shrinkwrap file</p> + +<h2 id="npm-start-3"><a href="../api/npm-start.html">npm-start(3)</a></h2> + +<p>Start a package</p> + +<h2 id="npm-stop-3"><a href="../api/npm-stop.html">npm-stop(3)</a></h2> + +<p>Stop a package</p> + +<h2 id="npm-submodule-3"><a href="../api/npm-submodule.html">npm-submodule(3)</a></h2> + +<p>Add a package as a git submodule</p> + +<h2 id="npm-tag-3"><a href="../api/npm-tag.html">npm-tag(3)</a></h2> + +<p>Tag a published version</p> + +<h2 id="npm-test-3"><a href="../api/npm-test.html">npm-test(3)</a></h2> + +<p>Test a package</p> + +<h2 id="npm-uninstall-3"><a href="../api/npm-uninstall.html">npm-uninstall(3)</a></h2> + +<p>uninstall a package programmatically</p> + +<h2 id="npm-unpublish-3"><a href="../api/npm-unpublish.html">npm-unpublish(3)</a></h2> + +<p>Remove a package from the registry</p> + +<h2 id="npm-update-3"><a href="../api/npm-update.html">npm-update(3)</a></h2> + +<p>Update a package</p> + +<h2 id="npm-version-3"><a href="../api/npm-version.html">npm-version(3)</a></h2> + +<p>Bump a package version</p> + +<h2 id="npm-view-3"><a href="../api/npm-view.html">npm-view(3)</a></h2> + +<p>View registry info</p> + +<h2 id="npm-whoami-3"><a href="../api/npm-whoami.html">npm-whoami(3)</a></h2> + +<p>Display npm username</p> + +<h1>Files</h1> + +<h2 id="npm-folders-5"><a href="../files/npm-folders.html">npm-folders(5)</a></h2> + +<p>Folder Structures Used by npm</p> + +<h2 id="npmrc-5"><a href="../files/npmrc.html">npmrc(5)</a></h2> + +<p>The npm config files</p> + +<h2 id="package-json-5"><a href="../files/package.json.html">package.json(5)</a></h2> + +<p>Specifics of npm's package.json handling</p> + +<h1>Misc</h1> + +<h2 id="npm-coding-style-7"><a href="../misc/npm-coding-style.html">npm-coding-style(7)</a></h2> + +<p>npm's "funny" coding style</p> + +<h2 id="npm-config-7"><a href="../misc/npm-config.html">npm-config(7)</a></h2> + +<p>More than you probably want to know about npm configuration</p> + +<h2 id="npm-developers-7"><a href="../misc/npm-developers.html">npm-developers(7)</a></h2> + +<p>Developer Guide</p> + +<h2 id="npm-disputes-7"><a href="../misc/npm-disputes.html">npm-disputes(7)</a></h2> + +<p>Handling Module Name Disputes</p> + +<h2 id="npm-faq-7"><a href="../misc/npm-faq.html">npm-faq(7)</a></h2> + +<p>Frequently Asked Questions</p> + +<h2 id="npm-registry-7"><a href="../misc/npm-registry.html">npm-registry(7)</a></h2> + +<p>The JavaScript Package Registry</p> + +<h2 id="npm-scripts-7"><a href="../misc/npm-scripts.html">npm-scripts(7)</a></h2> + +<p>How npm handles the "scripts" field</p> + +<h2 id="removing-npm-7"><a href="../misc/removing-npm.html">removing-npm(7)</a></h2> + +<p>Cleaning the Slate</p> + +<h2 id="semver-7"><a href="../misc/semver.html">semver(7)</a></h2> + +<p>The semantic versioner for npm</p> +</div> +<p id="footer">index — npm@1.3.2</p> +<script> +;(function () { +var wrapper = document.getElementById("wrapper") +var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) + .filter(function (el) { + return el.parentNode === wrapper + && el.tagName.match(/H[1-6]/) + && el.id + }) +var l = 2 + , toc = document.createElement("ul") +toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + , out = "" + while (i > l) { + out += "<ul>" + l ++ + } + while (i < l) { + out += "</ul>" + l -- + } + out += "<li><a href='#" + el.id + "'>" + + ( el.innerText || el.text || el.innerHTML) + + "</a>" + return out +}).join("\n") +toc.id = "toc" +document.body.appendChild(toc) +})() +</script> diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html new file mode 100644 index 0000000000..a44f1dead2 --- /dev/null +++ b/deps/npm/html/doc/misc/npm-coding-style.html @@ -0,0 +1,216 @@ +<!doctype html> +<html> + <title>npm-coding-style</title> + <meta http-equiv="content-type" value="text/html;utf-8"> + <link rel="stylesheet" type="text/css" href="../../static/style.css"> + + <body> + <div id="wrapper"> +<h1><a href="../misc/npm-coding-style.html">npm-coding-style</a></h1> <p>npm's "funny" coding style</p> + +<h2 id="DESCRIPTION">DESCRIPTION</h2> + +<p>npm's coding style is a bit unconventional. It is not different for +difference's sake, but rather a carefully crafted style that is +designed to reduce visual clutter and make bugs more apparent.</p> + +<p>If you want to contribute to npm (which is very encouraged), you should +make your code conform to npm's style.</p> + +<p>Note: this concerns npm's code not the specific packages at npmjs.org</p> + +<h2 id="Line-Length">Line Length</h2> + +<p>Keep lines shorter than 80 characters. It's better for lines to be +too short than to be too long. Break up long lists, objects, and other +statements onto multiple lines.</p> + +<h2 id="Indentation">Indentation</h2> + +<p>Two-spaces. Tabs are better, but they look like hell in web browsers +(and on github), and node uses 2 spaces, so that's that.</p> + +<p>Configure your editor appropriately.</p> + +<h2 id="Curly-braces">Curly braces</h2> + +<p>Curly braces belong on the same line as the thing that necessitates them.</p> + +<p>Bad:</p> + +<pre><code>function () +{</code></pre> + +<p>Good:</p> + +<pre><code>function () {</code></pre> + +<p>If a block needs to wrap to the next line, use a curly brace. Don't +use it if it doesn't.</p> + +<p>Bad:</p> + +<pre><code>if (foo) { bar() } +while (foo) + bar()</code></pre> + +<p>Good:</p> + +<pre><code>if (foo) bar() +while (foo) { + bar() +}</code></pre> + +<h2 id="Semicolons">Semicolons</h2> + +<p>Don't use them except in four situations:</p> + +<ul><li><code>for (;;)</code> loops. They're actually required.</li><li>null loops like: <code>while (something) ;</code> (But you'd better have a good +reason for doing that.)</li><li><code>case "foo": doSomething(); break</code></li><li>In front of a leading <code>(</code> or <code>[</code> at the start of the line. +This prevents the expression from being interpreted +as a function call or property access, respectively.</li></ul> + +<p>Some examples of good semicolon usage:</p> + +<pre><code>;(x || y).doSomething() +;[a, b, c].forEach(doSomething) +for (var i = 0; i < 10; i ++) { + switch (state) { + case "begin": start(); continue + case "end": finish(); break + default: throw new Error("unknown state") + } + end() +}</code></pre> + +<p>Note that starting lines with <code>-</code> and <code>+</code> also should be prefixed +with a semicolon, but this is much less common.</p> + +<h2 id="Comma-First">Comma First</h2> + +<p>If there is a list of things separated by commas, and it wraps +across multiple lines, put the comma at the start of the next +line, directly below the token that starts the list. Put the +final token in the list on a line by itself. For example:</p> + +<pre><code>var magicWords = [ "abracadabra" + , "gesundheit" + , "ventrilo" + ] + , spells = { "fireball" : function () { setOnFire() } + , "water" : function () { putOut() } + } + , a = 1 + , b = "abc" + , etc + , somethingElse</code></pre> + +<h2 id="Whitespace">Whitespace</h2> + +<p>Put a single space in front of ( for anything other than a function call. +Also use a single space wherever it makes things more readable.</p> + +<p>Don't leave trailing whitespace at the end of lines. Don't indent empty +lines. Don't use more spaces than are helpful.</p> + +<h2 id="Functions">Functions</h2> + +<p>Use named functions. They make stack traces a lot easier to read.</p> + +<h2 id="Callbacks-Sync-async-Style">Callbacks, Sync/async Style</h2> + +<p>Use the asynchronous/non-blocking versions of things as much as possible. +It might make more sense for npm to use the synchronous fs APIs, but this +way, the fs and http and child process stuff all uses the same callback-passing +methodology.</p> + +<p>The callback should always be the last argument in the list. Its first +argument is the Error or null.</p> + +<p>Be very careful never to ever ever throw anything. It's worse than useless. +Just send the error message back as the first argument to the callback.</p> + +<h2 id="Errors">Errors</h2> + +<p>Always create a new Error object with your message. Don't just return a +string message to the callback. Stack traces are handy.</p> + +<h2 id="Logging">Logging</h2> + +<p>Logging is done using the <a href="https://github.com/isaacs/npmlog">npmlog</a> +utility.</p> + +<p>Please clean up logs when they are no longer helpful. In particular, +logging the same object over and over again is not helpful. Logs should +report what's happening so that it's easier to track down where a fault +occurs.</p> + +<p>Use appropriate log levels. See <code><a href="../misc/npm-config.html">npm-config(7)</a></code> and search for +"loglevel".</p> + +<h2 id="Case-naming-etc">Case, naming, etc.</h2> + +<p>Use <code>lowerCamelCase</code> for multiword identifiers when they refer to objects, +functions, methods, members, or anything not specified in this section.</p> + +<p>Use <code>UpperCamelCase</code> for class names (things that you'd pass to "new").</p> + +<p>Use <code>all-lower-hyphen-css-case</code> for multiword filenames and config keys.</p> + +<p>Use named functions. They make stack traces easier to follow.</p> + +<p>Use <code>CAPS_SNAKE_CASE</code> for constants, things that should never change +and are rarely used.</p> + +<p>Use a single uppercase letter for function names where the function +would normally be anonymous, but needs to call itself recursively. It +makes it clear that it's a "throwaway" function.</p> + +<h2 id="null-undefined-false-0">null, undefined, false, 0</h2> + +<p>Boolean variables and functions should always be either <code>true</code> or +<code>false</code>. Don't set it to 0 unless it's supposed to be a number.</p> + +<p>When something is intentionally missing or removed, set it to <code>null</code>.</p> + +<p>Don't set things to <code>undefined</code>. Reserve that value to mean "not yet +set to anything."</p> + +<p>Boolean objects are verboten.</p> + +<h2 id="SEE-ALSO">SEE ALSO</h2> + +<ul><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul> +</div> +<p id="footer">npm-coding-style — npm@1.3.3</p> +<script> +;(function () { +var wrapper = document.getElementById("wrapper") +var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) + .filter(function (el) { + return el.parentNode === wrapper + && el.tagName.match(/H[1-6]/) + && el.id + }) +var l = 2 + , toc = document.createElement("ul") +toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + , out = "" + while (i > l) { + out += "<ul>" + l ++ + } + while (i < l) { + out += "</ul>" + l -- + } + out += "<li><a href='#" + el.id + "'>" + + ( el.innerText || el.text || el.innerHTML) + + "</a>" + return out +}).join("\n") +toc.id = "toc" +document.body.appendChild(toc) +})() +</script> diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html new file mode 100644 index 0000000000..22c6c78090 --- /dev/null +++ b/deps/npm/html/doc/misc/npm-config.html @@ -0,0 +1,751 @@ +<!doctype html> +<html> + <title>npm-config</title> + <meta http-equiv="content-type" value="text/html;utf-8"> + <link rel="stylesheet" type="text/css" href="../../static/style.css"> + + <body> + <div id="wrapper"> +<h1><a href="../misc/npm-config.html">npm-config</a></h1> <p>More than you probably want to know about npm configuration</p> + +<h2 id="DESCRIPTION">DESCRIPTION</h2> + +<p>npm gets its configuration values from 6 sources, in this priority:</p> + +<h3 id="Command-Line-Flags">Command Line Flags</h3> + +<p>Putting <code>--foo bar</code> on the command line sets the <code>foo</code> configuration +parameter to <code>"bar"</code>. A <code>--</code> argument tells the cli parser to stop +reading flags. A <code>--flag</code> parameter that is at the <em>end</em> of the +command will be given the value of <code>true</code>.</p> + +<h3 id="Environment-Variables">Environment Variables</h3> + +<p>Any environment variables that start with <code>npm_config_</code> will be +interpreted as a configuration parameter. For example, putting +<code>npm_config_foo=bar</code> in your environment will set the <code>foo</code> +configuration parameter to <code>bar</code>. Any environment configurations that +are not given a value will be given the value of <code>true</code>. Config +values are case-insensitive, so <code>NPM_CONFIG_FOO=bar</code> will work the +same.</p> + +<h3 id="npmrc-Files">npmrc Files</h3> + +<p>The three relevant files are:</p> + +<ul><li>per-user config file (~/.npmrc)</li><li>global config file ($PREFIX/npmrc)</li><li>npm builtin config file (/path/to/npm/npmrc)</li></ul> + +<p>See <a href="../files/npmrc.html">npmrc(5)</a> for more details.</p> + +<h3 id="Default-Configs">Default Configs</h3> + +<p>A set of configuration parameters that are internal to npm, and are +defaults if nothing else is specified.</p> + +<h2 id="Shorthands-and-Other-CLI-Niceties">Shorthands and Other CLI Niceties</h2> + +<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>-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>-B</code>: <code>--save-bundle</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 +parameter. For example:</p> + +<pre><code>npm ls --par +# same as: +npm ls --parseable</code></pre> + +<p>If multiple single-character shorthands are strung together, and the +resulting combination is unambiguously not some other configuration +param, then it is expanded to its various component pieces. For +example:</p> + +<pre><code>npm ls -gpld +# same as: +npm ls --global --parseable --long --loglevel info</code></pre> + +<h2 id="Per-Package-Config-Settings">Per-Package Config Settings</h2> + +<p>When running scripts (see <code><a href="../misc/npm-scripts.html">npm-scripts(7)</a></code>) the package.json "config" +keys are overwritten in the environment if there is a config param of +<code><name>[@<version>]:<key></code>. For example, if the package.json has +this:</p> + +<pre><code>{ "name" : "foo" +, "config" : { "port" : "8080" } +, "scripts" : { "start" : "node server.js" } }</code></pre> + +<p>and the server.js is this:</p> + +<pre><code>http.createServer(...).listen(process.env.npm_package_config_port)</code></pre> + +<p>then the user could change the behavior by doing:</p> + +<pre><code>npm config set foo:port 80</code></pre> + +<p>See <a href="../files/package.json.html">package.json(5)</a> for more information.</p> + +<h2 id="Config-Settings">Config Settings</h2> + +<h3 id="always-auth">always-auth</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>Force npm to always require authentication when accessing the registry, +even for <code>GET</code> requests.</p> + +<h3 id="bin-links">bin-links</h3> + +<ul><li>Default: <code>true</code></li><li>Type: Boolean</li></ul> + +<p>Tells npm to create symlinks (or <code>.cmd</code> shims on Windows) for package +executables.</p> + +<p>Set to false to have it not do this. This can be used to work around +the fact that some file systems don't support symlinks, even on +ostensibly Unix systems.</p> + +<h3 id="browser">browser</h3> + +<ul><li>Default: OS X: <code>"open"</code>, Windows: <code>"start"</code>, Others: <code>"xdg-open"</code></li><li>Type: String</li></ul> + +<p>The browser that is called by the <code>npm docs</code> command to open websites.</p> + +<h3 id="ca">ca</h3> + +<ul><li>Default: The npm CA certificate</li><li>Type: String or null</li></ul> + +<p>The Certificate Authority signing certificate that is trusted for SSL +connections to the registry.</p> + +<p>Set to <code>null</code> to only allow "known" registrars, or to a specific CA cert +to trust only that specific signing authority.</p> + +<p>See also the <code>strict-ssl</code> config.</p> + +<h3 id="cache">cache</h3> + +<ul><li>Default: Windows: <code>%APPDATA%\npm-cache</code>, Posix: <code>~/.npm</code></li><li>Type: path</li></ul> + +<p>The location of npm's cache directory. See <code><a href="../cli/npm-cache.html">npm-cache(1)</a></code></p> + +<h3 id="cache-lock-stale">cache-lock-stale</h3> + +<ul><li>Default: 60000 (1 minute)</li><li>Type: Number</li></ul> + +<p>The number of ms before cache folder lockfiles are considered stale.</p> + +<h3 id="cache-lock-retries">cache-lock-retries</h3> + +<ul><li>Default: 10</li><li>Type: Number</li></ul> + +<p>Number of times to retry to acquire a lock on cache folder lockfiles.</p> + +<h3 id="cache-lock-wait">cache-lock-wait</h3> + +<ul><li>Default: 10000 (10 seconds)</li><li>Type: Number</li></ul> + +<p>Number of ms to wait for cache lock files to expire.</p> + +<h3 id="cache-max">cache-max</h3> + +<ul><li>Default: Infinity</li><li>Type: Number</li></ul> + +<p>The maximum time (in seconds) to keep items in the registry cache before +re-checking against the registry.</p> + +<p>Note that no purging is done unless the <code>npm cache clean</code> command is +explicitly used, and that only GET requests use the cache.</p> + +<h3 id="cache-min">cache-min</h3> + +<ul><li>Default: 10</li><li>Type: Number</li></ul> + +<p>The minimum time (in seconds) to keep items in the registry cache before +re-checking against the registry.</p> + +<p>Note that no purging is done unless the <code>npm cache clean</code> command is +explicitly used, and that only GET requests use the cache.</p> + +<h3 id="color">color</h3> + +<ul><li>Default: true on Posix, false on Windows</li><li>Type: Boolean or <code>"always"</code></li></ul> + +<p>If false, never shows colors. If <code>"always"</code> then always shows colors. +If true, then only prints color codes for tty file descriptors.</p> + +<h3 id="coverage">coverage</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>A flag to tell test-harness to run with their coverage options enabled, +if they respond to the <code>npm_config_coverage</code> environment variable.</p> + +<h3 id="depth">depth</h3> + +<ul><li>Default: Infinity</li><li>Type: Number</li></ul> + +<p>The depth to go when recursing directories for <code>npm ls</code> and +<code>npm cache ls</code>.</p> + +<h3 id="description">description</h3> + +<ul><li>Default: true</li><li>Type: Boolean</li></ul> + +<p>Show the description in <code>npm search</code></p> + +<h3 id="dev">dev</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>Install <code>dev-dependencies</code> along with packages.</p> + +<p>Note that <code>dev-dependencies</code> are also installed if the <code>npat</code> flag is +set.</p> + +<h3 id="editor">editor</h3> + +<ul><li>Default: <code>EDITOR</code> environment variable if set, or <code>"vi"</code> on Posix, +or <code>"notepad"</code> on Windows.</li><li>Type: path</li></ul> + +<p>The command to run for <code>npm edit</code> or <code>npm config edit</code>.</p> + +<h3 id="engine-strict">engine-strict</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>If set to true, then npm will stubbornly refuse to install (or even +consider installing) any package that claims to not be compatible with +the current Node.js version.</p> + +<h3 id="force">force</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>Makes various commands more forceful.</p> + +<ul><li>lifecycle script failure does not block progress.</li><li>publishing clobbers previously published versions.</li><li>skips cache when requesting from the registry.</li><li>prevents checks against clobbering non-npm files.</li></ul> + +<h3 id="fetch-retries">fetch-retries</h3> + +<ul><li>Default: 2</li><li>Type: Number</li></ul> + +<p>The "retries" config for the <code>retry</code> module to use when fetching +packages from the registry.</p> + +<h3 id="fetch-retry-factor">fetch-retry-factor</h3> + +<ul><li>Default: 10</li><li>Type: Number</li></ul> + +<p>The "factor" config for the <code>retry</code> module to use when fetching +packages.</p> + +<h3 id="fetch-retry-mintimeout">fetch-retry-mintimeout</h3> + +<ul><li>Default: 10000 (10 seconds)</li><li>Type: Number</li></ul> + +<p>The "minTimeout" config for the <code>retry</code> module to use when fetching +packages.</p> + +<h3 id="fetch-retry-maxtimeout">fetch-retry-maxtimeout</h3> + +<ul><li>Default: 60000 (1 minute)</li><li>Type: Number</li></ul> + +<p>The "maxTimeout" config for the <code>retry</code> module to use when fetching +packages.</p> + +<h3 id="git">git</h3> + +<ul><li>Default: <code>"git"</code></li><li>Type: String</li></ul> + +<p>The command to use for git commands. If git is installed on the +computer, but is not in the <code>PATH</code>, then set this to the full path to +the git binary.</p> + +<h3 id="global">global</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>Operates in "global" mode, so that packages are installed into the +<code>prefix</code> folder instead of the current working directory. See +<code><a href="../misc/npm-folders.html">npm-folders(7)</a></code> for more on the differences in behavior.</p> + +<ul><li>packages are installed into the <code>{prefix}/lib/node_modules</code> folder, instead of the +current working directory.</li><li>bin files are linked to <code>{prefix}/bin</code></li><li>man pages are linked to <code>{prefix}/share/man</code></li></ul> + +<h3 id="globalconfig">globalconfig</h3> + +<ul><li>Default: {prefix}/etc/npmrc</li><li>Type: path</li></ul> + +<p>The config file to read for global config options.</p> + +<h3 id="globalignorefile">globalignorefile</h3> + +<ul><li>Default: {prefix}/etc/npmignore</li><li>Type: path</li></ul> + +<p>The config file to read for global ignore patterns to apply to all users +and all projects.</p> + +<p>If not found, but there is a "gitignore" file in the +same directory, then that will be used instead.</p> + +<h3 id="group">group</h3> + +<ul><li>Default: GID of the current process</li><li>Type: String or Number</li></ul> + +<p>The group to use when running package scripts in global mode as the root +user.</p> + +<h3 id="https-proxy">https-proxy</h3> + +<ul><li>Default: the <code>HTTPS_PROXY</code> or <code>https_proxy</code> or <code>HTTP_PROXY</code> or +<code>http_proxy</code> environment variables.</li><li>Type: url</li></ul> + +<p>A proxy to use for outgoing https requests.</p> + +<h3 id="user-agent">user-agent</h3> + +<ul><li>Default: node/{process.version} {process.platform} {process.arch}</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>A white-space separated list of glob patterns of files to always exclude +from packages when building tarballs.</p> + +<h3 id="init-module">init-module</h3> + +<ul><li>Default: ~/.npm-init.js</li><li>Type: path</li></ul> + +<p>A module that will be loaded by the <code>npm init</code> command. See the +documentation for the +<a href="https://github.com/isaacs/init-package-json">init-package-json</a> module +for more information, or <a href="../cli/npm-init.html">npm-init(1)</a>.</p> + +<h3 id="init-version">init.version</h3> + +<ul><li>Default: "0.0.0"</li><li>Type: semver</li></ul> + +<p>The value <code>npm init</code> should use by default for the package version.</p> + +<h3 id="init-author-name">init.author.name</h3> + +<ul><li>Default: ""</li><li>Type: String</li></ul> + +<p>The value <code>npm init</code> should use by default for the package author's name.</p> + +<h3 id="init-author-email">init.author.email</h3> + +<ul><li>Default: ""</li><li>Type: String</li></ul> + +<p>The value <code>npm init</code> should use by default for the package author's email.</p> + +<h3 id="init-author-url">init.author.url</h3> + +<ul><li>Default: ""</li><li>Type: String</li></ul> + +<p>The value <code>npm init</code> should use by default for the package author's homepage.</p> + +<h3 id="json">json</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>Whether or not to output JSON data, rather than the normal output.</p> + +<p>This feature is currently experimental, and the output data structures +for many commands is either not implemented in JSON yet, or subject to +change. Only the output from <code>npm ls --json</code> is currently valid.</p> + +<h3 id="link">link</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>If true, then local installs will link if there is a suitable globally +installed package.</p> + +<p>Note that this means that local installs can cause things to be +installed into the global space at the same time. The link is only done +if one of the two conditions are met:</p> + +<ul><li>The package is not already installed globally, or</li><li>the globally installed version is identical to the version that is +being installed locally.</li></ul> + +<h3 id="loglevel">loglevel</h3> + +<ul><li>Default: "http"</li><li>Type: String</li><li>Values: "silent", "win", "error", "warn", "http", "info", "verbose", "silly"</li></ul> + +<p>What level of logs to report. On failure, <em>all</em> logs are written to +<code>npm-debug.log</code> in the current working directory.</p> + +<p>Any logs of a higher level than the setting are shown. +The default is "http", which shows http, warn, and error output.</p> + +<h3 id="logstream">logstream</h3> + +<ul><li>Default: process.stderr</li><li>Type: Stream</li></ul> + +<p>This is the stream that is passed to the +<a href="https://github.com/isaacs/npmlog">npmlog</a> module at run time.</p> + +<p>It cannot be set from the command line, but if you are using npm +programmatically, you may wish to send logs to somewhere other than +stderr.</p> + +<p>If the <code>color</code> config is set to true, then this stream will receive +colored output if it is a TTY.</p> + +<h3 id="long">long</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>Show extended information in <code>npm ls</code></p> + +<h3 id="message">message</h3> + +<ul><li>Default: "%s"</li><li>Type: String</li></ul> + +<p>Commit message which is used by <code>npm version</code> when creating version commit.</p> + +<p>Any "%s" in the message will be replaced with the version number.</p> + +<h3 id="node-version">node-version</h3> + +<ul><li>Default: process.version</li><li>Type: semver or false</li></ul> + +<p>The node version to use when checking package's "engines" hash.</p> + +<h3 id="npat">npat</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>Run tests on installation and report results to the +<code>npaturl</code>.</p> + +<h3 id="npaturl">npaturl</h3> + +<ul><li>Default: Not yet implemented</li><li>Type: url</li></ul> + +<p>The url to report npat test results.</p> + +<h3 id="onload-script">onload-script</h3> + +<ul><li>Default: false</li><li>Type: path</li></ul> + +<p>A node module to <code>require()</code> when npm loads. Useful for programmatic +usage.</p> + +<h3 id="optional">optional</h3> + +<ul><li>Default: true</li><li>Type: Boolean</li></ul> + +<p>Attempt to install packages in the <code>optionalDependencies</code> hash. Note +that if these packages fail to install, the overall installation +process is not aborted.</p> + +<h3 id="parseable">parseable</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>Output parseable results from commands that write to +standard output.</p> + +<h3 id="prefix">prefix</h3> + +<ul><li>Default: see <a href="../misc/npm-folders.html">npm-folders(7)</a></li><li>Type: path</li></ul> + +<p>The location to install global items. If set on the command line, then +it forces non-global commands to run in the specified folder.</p> + +<h3 id="production">production</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>Set to true to run in "production" mode.</p> + +<ol><li>devDependencies are not installed at the topmost level when running +local <code>npm install</code> without any arguments.</li><li>Set the NODE_ENV="production" for lifecycle scripts.</li></ol> + +<h3 id="proprietary-attribs">proprietary-attribs</h3> + +<ul><li>Default: true</li><li>Type: Boolean</li></ul> + +<p>Whether or not to include proprietary extended attributes in the +tarballs created by npm.</p> + +<p>Unless you are expecting to unpack package tarballs with something other +than npm -- particularly a very outdated tar implementation -- leave +this as true.</p> + +<h3 id="proxy">proxy</h3> + +<ul><li>Default: <code>HTTP_PROXY</code> or <code>http_proxy</code> environment variable, or null</li><li>Type: url</li></ul> + +<p>A proxy to use for outgoing http requests.</p> + +<h3 id="rebuild-bundle">rebuild-bundle</h3> + +<ul><li>Default: true</li><li>Type: Boolean</li></ul> + +<p>Rebuild bundled dependencies after installation.</p> + +<h3 id="registry">registry</h3> + +<ul><li>Default: https://registry.npmjs.org/</li><li>Type: url</li></ul> + +<p>The base URL of the npm package registry.</p> + +<h3 id="rollback">rollback</h3> + +<ul><li>Default: true</li><li>Type: Boolean</li></ul> + +<p>Remove failed installs.</p> + +<h3 id="save">save</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>Save installed packages to a package.json file as dependencies.</p> + +<p>When used with the <code>npm rm</code> command, it removes it from the dependencies +hash.</p> + +<p>Only works if there is already a package.json file present.</p> + +<h3 id="save-bundle">save-bundle</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>If a package would be saved at install time by the use of <code>--save</code>, +<code>--save-dev</code>, or <code>--save-optional</code>, then also put it in the +<code>bundleDependencies</code> list.</p> + +<p>When used with the <code>npm rm</code> command, it removes it from the +bundledDependencies list.</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>When used with the <code>npm rm</code> command, it removes it from the devDependencies +hash.</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>When used with the <code>npm rm</code> command, it removes it from the devDependencies +hash.</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> + +<p>Space-separated options that are always passed to search.</p> + +<h3 id="searchexclude">searchexclude</h3> + +<ul><li>Default: ""</li><li>Type: String</li></ul> + +<p>Space-separated options that limit the results from search.</p> + +<h3 id="searchsort">searchsort</h3> + +<ul><li>Default: "name"</li><li>Type: String</li><li>Values: "name", "-name", "date", "-date", "description", +"-description", "keywords", "-keywords"</li></ul> + +<p>Indication of which field to sort search results by. Prefix with a <code>-</code> +character to indicate reverse sort.</p> + +<h3 id="shell">shell</h3> + +<ul><li>Default: SHELL environment variable, or "bash" on Posix, or "cmd" on +Windows</li><li>Type: path</li></ul> + +<p>The shell to run for the <code>npm explore</code> command.</p> + +<h3 id="shrinkwrap">shrinkwrap</h3> + +<ul><li>Default: true</li><li>Type: Boolean</li></ul> + +<p>If set to false, then ignore <code>npm-shrinkwrap.json</code> files when +installing.</p> + +<h3 id="sign-git-tag">sign-git-tag</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>If set to true, then the <code>npm version</code> command will tag the version +using <code>-s</code> to add a signature.</p> + +<p>Note that git requires you to have set up GPG keys in your git configs +for this to work properly.</p> + +<h3 id="strict-ssl">strict-ssl</h3> + +<ul><li>Default: true</li><li>Type: Boolean</li></ul> + +<p>Whether or not to do SSL key validation when making requests to the +registry via https.</p> + +<p>See also the <code>ca</code> config.</p> + +<h3 id="tag">tag</h3> + +<ul><li>Default: latest</li><li>Type: String</li></ul> + +<p>If you ask npm to install a package and don't tell it a specific version, then +it will install the specified tag.</p> + +<p>Also the tag that is added to the package@version specified by the <code>npm +tag</code> command, if no explicit tag is given.</p> + +<h3 id="tmp">tmp</h3> + +<ul><li>Default: TMPDIR environment variable, or "/tmp"</li><li>Type: path</li></ul> + +<p>Where to store temporary files and folders. All temp files are deleted +on success, but left behind on failure for forensic purposes.</p> + +<h3 id="unicode">unicode</h3> + +<ul><li>Default: true</li><li>Type: Boolean</li></ul> + +<p>When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters to draw trees.</p> + +<h3 id="unsafe-perm">unsafe-perm</h3> + +<ul><li>Default: false if running as root, true otherwise</li><li>Type: Boolean</li></ul> + +<p>Set to true to suppress the UID/GID switching when running package +scripts. If set explicitly to false, then installing as a non-root user +will fail.</p> + +<h3 id="usage">usage</h3> + +<ul><li>Default: false</li><li>Type: Boolean</li></ul> + +<p>Set to show short usage output (like the -H output) +instead of complete help when doing <code><a href="../cli/npm-help.html">npm-help(1)</a></code>.</p> + +<h3 id="user">user</h3> + +<ul><li>Default: "nobody"</li><li>Type: String or Number</li></ul> + +<p>The UID to set to when running package scripts as root.</p> + +<h3 id="username">username</h3> + +<ul><li>Default: null</li><li>Type: String</li></ul> + +<p>The username on the npm registry. Set with <code>npm adduser</code></p> + +<h3 id="userconfig">userconfig</h3> + +<ul><li>Default: ~/.npmrc</li><li>Type: path</li></ul> + +<p>The location of user-level configuration settings.</p> + +<h3 id="userignorefile">userignorefile</h3> + +<ul><li>Default: ~/.npmignore</li><li>Type: path</li></ul> + +<p>The location of a user-level ignore file to apply to all packages.</p> + +<p>If not found, but there is a .gitignore file in the same directory, then +that will be used instead.</p> + +<h3 id="umask">umask</h3> + +<ul><li>Default: 022</li><li>Type: Octal numeric string</li></ul> + +<p>The "umask" value to use when setting the file creation mode on files +and folders.</p> + +<p>Folders and executables are given a mode which is <code>0777</code> masked against +this value. Other files are given a mode which is <code>0666</code> masked against +this value. Thus, the defaults are <code>0755</code> and <code>0644</code> respectively.</p> + +<h3 id="version">version</h3> + +<ul><li>Default: false</li><li>Type: boolean</li></ul> + +<p>If true, output the npm version and exit successfully.</p> + +<p>Only relevant when specified explicitly on the command line.</p> + +<h3 id="versions">versions</h3> + +<ul><li>Default: false</li><li>Type: boolean</li></ul> + +<p>If true, output the npm version as well as node's <code>process.versions</code> +hash, and exit successfully.</p> + +<p>Only relevant when specified explicitly on the command line.</p> + +<h3 id="viewer">viewer</h3> + +<ul><li>Default: "man" on Posix, "browser" on Windows</li><li>Type: path</li></ul> + +<p>The program to use to view help content.</p> + +<p>Set to <code>"browser"</code> to view html help content in the default web browser.</p> + +<h3 id="yes">yes</h3> + +<ul><li>Default: null</li><li>Type: Boolean or null</li></ul> + +<p>If set to <code>null</code>, then prompt the user for responses in some +circumstances.</p> + +<p>If set to <code>true</code>, then answer "yes" to any prompt. If set to <code>false</code> +then answer "no" to any prompt.</p> + +<h2 id="SEE-ALSO">SEE ALSO</h2> + +<ul><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul> +</div> +<p id="footer">npm-config — npm@1.3.3</p> +<script> +;(function () { +var wrapper = document.getElementById("wrapper") +var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) + .filter(function (el) { + return el.parentNode === wrapper + && el.tagName.match(/H[1-6]/) + && el.id + }) +var l = 2 + , toc = document.createElement("ul") +toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + , out = "" + while (i > l) { + out += "<ul>" + l ++ + } + while (i < l) { + out += "</ul>" + l -- + } + out += "<li><a href='#" + el.id + "'>" + + ( el.innerText || el.text || el.innerHTML) + + "</a>" + return out +}).join("\n") +toc.id = "toc" +document.body.appendChild(toc) +})() +</script> diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html new file mode 100644 index 0000000000..3160d46bbf --- /dev/null +++ b/deps/npm/html/doc/misc/npm-developers.html @@ -0,0 +1,208 @@ +<!doctype html> +<html> + <title>npm-developers</title> + <meta http-equiv="content-type" value="text/html;utf-8"> + <link rel="stylesheet" type="text/css" href="../../static/style.css"> + + <body> + <div id="wrapper"> +<h1><a href="../misc/npm-developers.html">npm-developers</a></h1> <p>Developer Guide</p> + +<h2 id="DESCRIPTION">DESCRIPTION</h2> + +<p>So, you've decided to use npm to develop (and maybe publish/deploy) +your project.</p> + +<p>Fantastic!</p> + +<p>There are a few things that you need to do above the simple steps +that your users will do to install your program.</p> + +<h2 id="About-These-Documents">About These Documents</h2> + +<p>These are man pages. If you install npm, you should be able to +then do <code>man npm-thing</code> to get the documentation on a particular +topic, or <code>npm help thing</code> to see the same information.</p> + +<h2 id="What-is-a-package">What is a <code>package</code></h2> + +<p>A package is:</p> + +<ul><li>a) a folder containing a program described by a package.json file</li><li>b) a gzipped tarball containing (a)</li><li>c) a url that resolves to (b)</li><li>d) a <code><name>@<version></code> that is published on the registry with (c)</li><li>e) a <code><name>@<tag></code> that points to (d)</li><li>f) a <code><name></code> that has a "latest" tag satisfying (e)</li><li>g) a <code>git</code> url that, when cloned, results in (a).</li></ul> + +<p>Even if you never publish your package, you can still get a lot of +benefits of using npm if you just want to write a node program (a), and +perhaps if you also want to be able to easily install it elsewhere +after packing it up into a tarball (b).</p> + +<p>Git urls can be of the form:</p> + +<pre><code>git://github.com/user/project.git#commit-ish +git+ssh://user@hostname:project.git#commit-ish +git+http://user@hostname/project/blah.git#commit-ish +git+https://user@hostname/project/blah.git#commit-ish</code></pre> + +<p>The <code>commit-ish</code> can be any tag, sha, or branch which can be supplied as +an argument to <code>git checkout</code>. The default is <code>master</code>.</p> + +<h2 id="The-package-json-File">The package.json File</h2> + +<p>You need to have a <code>package.json</code> file in the root of your project to do +much of anything with npm. That is basically the whole interface.</p> + +<p>See <code><a href="../files/package.json.html">package.json(5)</a></code> for details about what goes in that file. At the very +least, you need:</p> + +<ul><li><p>name: +This should be a string that identifies your project. Please do not +use the name to specify that it runs on node, or is in JavaScript. +You can use the "engines" field to explicitly state the versions of +node (or whatever else) that your program requires, and it's pretty +well assumed that it's javascript.</p><p>It does not necessarily need to match your github repository name.</p><p>So, <code>node-foo</code> and <code>bar-js</code> are bad names. <code>foo</code> or <code>bar</code> are better.</p></li><li><p>version: +A semver-compatible version.</p></li><li><p>engines: +Specify the versions of node (or whatever else) that your program +runs on. The node API changes a lot, and there may be bugs or new +functionality that you depend on. Be explicit.</p></li><li><p>author: +Take some credit.</p></li><li><p>scripts: +If you have a special compilation or installation script, then you +should put it in the <code>scripts</code> hash. You should definitely have at +least a basic smoke-test command as the "scripts.test" field. +See <a href="../misc/npm-scripts.html">npm-scripts(7)</a>.</p></li><li><p>main: +If you have a single module that serves as the entry point to your +program (like what the "foo" package gives you at require("foo")), +then you need to specify that in the "main" field.</p></li><li><p>directories: +This is a hash of folders. The best ones to include are "lib" and +"doc", but if you specify a folder full of man pages in "man", then +they'll get installed just like these ones.</p></li></ul> + +<p>You can use <code>npm init</code> in the root of your package in order to get you +started with a pretty basic package.json file. See <code><a href="../cli/npm-init.html">npm-init(1)</a></code> for +more info.</p> + +<h2 id="Keeping-files-out-of-your-package">Keeping files <em>out</em> of your package</h2> + +<p>Use a <code>.npmignore</code> file to keep stuff out of your package. If there's +no <code>.npmignore</code> file, but there <em>is</em> a <code>.gitignore</code> file, then npm will +ignore the stuff matched by the <code>.gitignore</code> file. If you <em>want</em> to +include something that is excluded by your <code>.gitignore</code> file, you can +create an empty <code>.npmignore</code> file to override it.</p> + +<p>By default, the following paths and files are ignored, so there's no +need to add them to <code>.npmignore</code> explicitly:</p> + +<ul><li><code>.*.swp</code></li><li><code>._*</code></li><li><code>.DS_Store</code></li><li><code>.git</code></li><li><code>.hg</code></li><li><code>.lock-wscript</code></li><li><code>.svn</code></li><li><code>.wafpickle-*</code></li><li><code>CVS</code></li><li><code>npm-debug.log</code></li></ul> + +<p>Additionally, everything in <code>node_modules</code> is ignored, except for +bundled dependencies. npm automatically handles this for you, so don't +bother adding <code>node_modules</code> to <code>.npmignore</code>.</p> + +<p>The following paths and files are never ignored, so adding them to +<code>.npmignore</code> is pointless:</p> + +<ul><li><code>package.json</code></li><li><code><a href="../../doc/README.html">README</a>.*</code></li></ul> + +<h2 id="Link-Packages">Link Packages</h2> + +<p><code>npm link</code> is designed to install a development package and see the +changes in real time without having to keep re-installing it. (You do +need to either re-link or <code>npm rebuild -g</code> to update compiled packages, +of course.)</p> + +<p>More info at <code><a href="../cli/npm-link.html">npm-link(1)</a></code>.</p> + +<h2 id="Before-Publishing-Make-Sure-Your-Package-Installs-and-Works">Before Publishing: Make Sure Your Package Installs and Works</h2> + +<p><strong>This is important.</strong></p> + +<p>If you can not install it locally, you'll have +problems trying to publish it. Or, worse yet, you'll be able to +publish it, but you'll be publishing a broken or pointless package. +So don't do that.</p> + +<p>In the root of your package, do this:</p> + +<pre><code>npm install . -g</code></pre> + +<p>That'll show you that it's working. If you'd rather just create a symlink +package that points to your working directory, then do this:</p> + +<pre><code>npm link</code></pre> + +<p>Use <code>npm ls -g</code> to see if it's there.</p> + +<p>To test a local install, go into some other folder, and then do:</p> + +<pre><code>cd ../some-other-folder +npm install ../my-package</code></pre> + +<p>to install it locally into the node_modules folder in that other place.</p> + +<p>Then go into the node-repl, and try using require("my-thing") to +bring in your module's main module.</p> + +<h2 id="Create-a-User-Account">Create a User Account</h2> + +<p>Create a user with the adduser command. It works like this:</p> + +<pre><code>npm adduser</code></pre> + +<p>and then follow the prompts.</p> + +<p>This is documented better in <a href="../cli/npm-adduser.html">npm-adduser(1)</a>.</p> + +<h2 id="Publish-your-package">Publish your package</h2> + +<p>This part's easy. IN the root of your folder, do this:</p> + +<pre><code>npm publish</code></pre> + +<p>You can give publish a url to a tarball, or a filename of a tarball, +or a path to a folder.</p> + +<p>Note that pretty much <strong>everything in that folder will be exposed</strong> +by default. So, if you have secret stuff in there, use a +<code>.npmignore</code> file to list out the globs to ignore, or publish +from a fresh checkout.</p> + +<h2 id="Brag-about-it">Brag about it</h2> + +<p>Send emails, write blogs, blab in IRC.</p> + +<p>Tell the world how easy it is to install your program!</p> + +<h2 id="SEE-ALSO">SEE ALSO</h2> + +<ul><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm.html">npm(1)</a></li><li><a href="../cli/npm-init.html">npm-init(1)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li></ul> +</div> +<p id="footer">npm-developers — npm@1.3.3</p> +<script> +;(function () { +var wrapper = document.getElementById("wrapper") +var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) + .filter(function (el) { + return el.parentNode === wrapper + && el.tagName.match(/H[1-6]/) + && el.id + }) +var l = 2 + , toc = document.createElement("ul") +toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + , out = "" + while (i > l) { + out += "<ul>" + l ++ + } + while (i < l) { + out += "</ul>" + l -- + } + out += "<li><a href='#" + el.id + "'>" + + ( el.innerText || el.text || el.innerHTML) + + "</a>" + return out +}).join("\n") +toc.id = "toc" +document.body.appendChild(toc) +})() +</script> diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html new file mode 100644 index 0000000000..a383e7657e --- /dev/null +++ b/deps/npm/html/doc/misc/npm-disputes.html @@ -0,0 +1,125 @@ +<!doctype html> +<html> + <title>npm-disputes</title> + <meta http-equiv="content-type" value="text/html;utf-8"> + <link rel="stylesheet" type="text/css" href="../../static/style.css"> + + <body> + <div id="wrapper"> +<h1><a href="../misc/npm-disputes.html">npm-disputes</a></h1> <p>Handling Module Name Disputes</p> + +<h2 id="SYNOPSIS">SYNOPSIS</h2> + +<ol><li>Get the author email with <code>npm owner ls <pkgname></code></li><li>Email the author, CC <a href="mailto:i@izs.me">i@izs.me</a>.</li><li>After a few weeks, if there's no resolution, we'll sort it out.</li></ol> + +<p>Don't squat on package names. Publish code or move out of the way.</p> + +<h2 id="DESCRIPTION">DESCRIPTION</h2> + +<p>There sometimes arise cases where a user publishes a module, and then +later, some other user wants to use that name. Here are some common +ways that happens (each of these is based on actual events.)</p> + +<ol><li>Joe writes a JavaScript module <code>foo</code>, which is not node-specific. +Joe doesn't use node at all. Bob wants to use <code>foo</code> in node, so he +wraps it in an npm module. Some time later, Joe starts using node, +and wants to take over management of his program.</li><li>Bob writes an npm module <code>foo</code>, and publishes it. Perhaps much +later, Joe finds a bug in <code>foo</code>, and fixes it. He sends a pull +request to Bob, but Bob doesn't have the time to deal with it, +because he has a new job and a new baby and is focused on his new +erlang project, and kind of not involved with node any more. Joe +would like to publish a new <code>foo</code>, but can't, because the name is +taken.</li><li>Bob writes a 10-line flow-control library, and calls it <code>foo</code>, and +publishes it to the npm registry. Being a simple little thing, it +never really has to be updated. Joe works for Foo Inc, the makers +of the critically acclaimed and widely-marketed <code>foo</code> JavaScript +toolkit framework. They publish it to npm as <code>foojs</code>, but people are +routinely confused when <code>npm install foo</code> is some different thing.</li><li>Bob writes a parser for the widely-known <code>foo</code> file format, because +he needs it for work. Then, he gets a new job, and never updates the +prototype. Later on, Joe writes a much more complete <code>foo</code> parser, +but can't publish, because Bob's <code>foo</code> is in the way.</li></ol> + +<p>The validity of Joe's claim in each situation can be debated. However, +Joe's appropriate course of action in each case is the same.</p> + +<ol><li><code>npm owner ls foo</code>. This will tell Joe the email address of the +owner (Bob).</li><li>Joe emails Bob, explaining the situation <strong>as respectfully as possible</strong>, +and what he would like to do with the module name. He adds +isaacs <a href="mailto:i@izs.me">i@izs.me</a> to the CC list of the email. Mention in the email +that Bob can run <code>npm owner add joe foo</code> to add Joe as an owner of +the <code>foo</code> package.</li><li>After a reasonable amount of time, if Bob has not responded, or if +Bob and Joe can't come to any sort of resolution, email isaacs +<a href="mailto:i@izs.me">i@izs.me</a> and we'll sort it out. ("Reasonable" is usually about 4 +weeks, but extra time is allowed around common holidays.)</li></ol> + +<h2 id="REASONING">REASONING</h2> + +<p>In almost every case so far, the parties involved have been able to reach +an amicable resolution without any major intervention. Most people +really do want to be reasonable, and are probably not even aware that +they're in your way.</p> + +<p>Module ecosystems are most vibrant and powerful when they are as +self-directed as possible. If an admin one day deletes something you +had worked on, then that is going to make most people quite upset, +regardless of the justification. When humans solve their problems by +talking to other humans with respect, everyone has the chance to end up +feeling good about the interaction.</p> + +<h2 id="EXCEPTIONS">EXCEPTIONS</h2> + +<p>Some things are not allowed, and will be removed without discussion if +they are brought to the attention of the npm registry admins, including +but not limited to:</p> + +<ol><li>Malware (that is, a package designed to exploit or harm the machine on +which it is installed).</li><li>Violations of copyright or licenses (for example, cloning an +MIT-licensed program, and then removing or changing the copyright and +license statement).</li><li>Illegal content.</li><li>"Squatting" on a package name that you <em>plan</em> to use, but aren't +actually using. Sorry, I don't care how great the name is, or how +perfect a fit it is for the thing that someday might happen. If +someone wants to use it today, and you're just taking up space with +an empty tarball, you're going to be evicted.</li><li>Putting empty packages in the registry. Packages must have SOME +functionality. It can be silly, but it can't be <em>nothing</em>. (See +also: squatting.)</li><li>Doing weird things with the registry, like using it as your own +personal application database or otherwise putting non-packagey +things into it.</li></ol> + +<p>If you see bad behavior like this, please report it right away.</p> + +<h2 id="SEE-ALSO">SEE ALSO</h2> + +<ul><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-owner.html">npm-owner(1)</a></li></ul> +</div> +<p id="footer">npm-disputes — npm@1.3.3</p> +<script> +;(function () { +var wrapper = document.getElementById("wrapper") +var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) + .filter(function (el) { + return el.parentNode === wrapper + && el.tagName.match(/H[1-6]/) + && el.id + }) +var l = 2 + , toc = document.createElement("ul") +toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + , out = "" + while (i > l) { + out += "<ul>" + l ++ + } + while (i < l) { + out += "</ul>" + l -- + } + out += "<li><a href='#" + el.id + "'>" + + ( el.innerText || el.text || el.innerHTML) + + "</a>" + return out +}).join("\n") +toc.id = "toc" +document.body.appendChild(toc) +})() +</script> diff --git a/deps/npm/html/doc/misc/npm-faq.html b/deps/npm/html/doc/misc/npm-faq.html new file mode 100644 index 0000000000..854c87b9a7 --- /dev/null +++ b/deps/npm/html/doc/misc/npm-faq.html @@ -0,0 +1,374 @@ +<!doctype html> +<html> + <title>npm-faq</title> + <meta http-equiv="content-type" value="text/html;utf-8"> + <link rel="stylesheet" type="text/css" href="../../static/style.css"> + + <body> + <div id="wrapper"> +<h1><a href="../misc/npm-faq.html">npm-faq</a></h1> <p>Frequently Asked Questions</p> + +<h2 id="Where-can-I-find-these-docs-in-HTML">Where can I find these docs in HTML?</h2> + +<p><a href="https://npmjs.org/doc/">https://npmjs.org/doc/</a>, or run:</p> + +<pre><code>npm config set viewer browser</code></pre> + +<p>to open these documents in your default web browser rather than <code>man</code>.</p> + +<h2 id="It-didn-t-work">It didn't work.</h2> + +<p>That's not really a question.</p> + +<h2 id="Why-didn-t-it-work">Why didn't it work?</h2> + +<p>I don't know yet.</p> + +<p>Read the error output, and if you can't figure out what it means, +do what it says and post a bug with all the information it asks for.</p> + +<h2 id="Where-does-npm-put-stuff">Where does npm put stuff?</h2> + +<p>See <code><a href="../files/npm-folders.html">npm-folders(5)</a></code></p> + +<p>tl;dr:</p> + +<ul><li>Use the <code>npm root</code> command to see where modules go, and the <code>npm bin</code> +command to see where executables go</li><li>Global installs are different from local installs. If you install +something with the <code>-g</code> flag, then its executables go in <code>npm bin -g</code> +and its modules go in <code>npm root -g</code>.</li></ul> + +<h2 id="How-do-I-install-something-on-my-computer-in-a-central-location">How do I install something on my computer in a central location?</h2> + +<p>Install it globally by tacking <code>-g</code> or <code>--global</code> to the command. (This +is especially important for command line utilities that need to add +their bins to the global system <code>PATH</code>.)</p> + +<h2 id="I-installed-something-globally-but-I-can-t-require-it">I installed something globally, but I can't <code>require()</code> it</h2> + +<p>Install it locally.</p> + +<p>The global install location is a place for command-line utilities +to put their bins in the system <code>PATH</code>. It's not for use with <code>require()</code>.</p> + +<p>If you <code>require()</code> a module in your code, then that means it's a +dependency, and a part of your program. You need to install it locally +in your program.</p> + +<h2 id="Why-can-t-npm-just-put-everything-in-one-place-like-other-package-managers">Why can't npm just put everything in one place, like other package managers?</h2> + +<p>Not every change is an improvement, but every improvement is a change. +This would be like asking git to do network IO for every commit. It's +not going to happen, because it's a terrible idea that causes more +problems than it solves.</p> + +<p>It is much harder to avoid dependency conflicts without nesting +dependencies. This is fundamental to the way that npm works, and has +proven to be an extremely successful approach. See <code><a href="../files/npm-folders.html">npm-folders(5)</a></code> for +more details.</p> + +<p>If you want a package to be installed in one place, and have all your +programs reference the same copy of it, then use the <code>npm link</code> command. +That's what it's for. Install it globally, then link it into each +program that uses it.</p> + +<h2 id="Whatever-I-really-want-the-old-style-everything-global-style">Whatever, I really want the old style 'everything global' style.</h2> + +<p>Write your own package manager, then. It's not that hard.</p> + +<p>npm will not help you do something that is known to be a bad idea.</p> + +<h2 id="Should-I-check-my-node_modules-folder-into-git">Should I check my <code>node_modules</code> folder into git?</h2> + +<p>Mikeal Rogers answered this question very well:</p> + +<p><a href="http://www.mikealrogers.com/posts/nodemodules-in-git.html">http://www.mikealrogers.com/posts/nodemodules-in-git.html</a></p> + +<p>tl;dr</p> + +<ul><li>Check <code>node_modules</code> into git for things you <strong>deploy</strong>, such as +websites and apps.</li><li>Do not check <code>node_modules</code> into git for libraries and modules +intended to be reused.</li><li>Use npm to manage dependencies in your dev environment, but not in +your deployment scripts.</li></ul> + +<h2 id="Is-it-npm-or-NPM-or-Npm">Is it 'npm' or 'NPM' or 'Npm'?</h2> + +<p>npm should never be capitalized unless it is being displayed in a +location that is customarily all-caps (such as the title of man pages.)</p> + +<h2 id="If-npm-is-an-acronym-why-is-it-never-capitalized">If 'npm' is an acronym, why is it never capitalized?</h2> + +<p>Contrary to the belief of many, "npm" is not in fact an abbreviation for +"Node Package Manager". It is a recursive bacronymic abbreviation for +"npm is not an acronym". (If it was "ninaa", then it would be an +acronym, and thus incorrectly named.)</p> + +<p>"NPM", however, <em>is</em> an acronym (more precisely, a capitonym) for the +National Association of Pastoral Musicians. You can learn more +about them at <a href="http://npm.org/">http://npm.org/</a>.</p> + +<p>In software, "NPM" is a Non-Parametric Mapping utility written by +Chris Rorden. You can analyze pictures of brains with it. Learn more +about the (capitalized) NPM program at <a href="http://www.cabiatl.com/mricro/npm/">http://www.cabiatl.com/mricro/npm/</a>.</p> + +<p>The first seed that eventually grew into this flower was a bash utility +named "pm", which was a shortened descendent of "pkgmakeinst", a +bash function that was used to install various different things on different +platforms, most often using Yahoo's <code>yinst</code>. If <code>npm</code> was ever an +acronym for anything, it was <code>node pm</code> or maybe <code>new pm</code>.</p> + +<p>So, in all seriousness, the "npm" project is named after its command-line +utility, which was organically selected to be easily typed by a right-handed +programmer using a US QWERTY keyboard layout, ending with the +right-ring-finger in a postition to type the <code>-</code> key for flags and +other command-line arguments. That command-line utility is always +lower-case, though it starts most sentences it is a part of.</p> + +<h2 id="How-do-I-list-installed-packages">How do I list installed packages?</h2> + +<p><code>npm ls</code></p> + +<h2 id="How-do-I-search-for-packages">How do I search for packages?</h2> + +<p><code>npm search</code></p> + +<p>Arguments are greps. <code>npm search jsdom</code> shows jsdom packages.</p> + +<h2 id="How-do-I-update-npm">How do I update npm?</h2> + +<pre><code>npm update npm -g</code></pre> + +<p>You can also update all outdated local packages by doing <code>npm update</code> without +any arguments, or global packages by doing <code>npm update -g</code>.</p> + +<p>Occasionally, the version of npm will progress such that the current +version cannot be properly installed with the version that you have +installed already. (Consider, if there is ever a bug in the <code>update</code> +command.)</p> + +<p>In those cases, you can do this:</p> + +<pre><code>curl https://npmjs.org/install.sh | sh</code></pre> + +<h2 id="What-is-a-package">What is a <code>package</code>?</h2> + +<p>A package is:</p> + +<ul><li>a) a folder containing a program described by a package.json file</li><li>b) a gzipped tarball containing (a)</li><li>c) a url that resolves to (b)</li><li>d) a <code><name>@<version></code> that is published on the registry with (c)</li><li>e) a <code><name>@<tag></code> that points to (d)</li><li>f) a <code><name></code> that has a "latest" tag satisfying (e)</li><li>g) a <code>git</code> url that, when cloned, results in (a).</li></ul> + +<p>Even if you never publish your package, you can still get a lot of +benefits of using npm if you just want to write a node program (a), and +perhaps if you also want to be able to easily install it elsewhere +after packing it up into a tarball (b).</p> + +<p>Git urls can be of the form:</p> + +<pre><code>git://github.com/user/project.git#commit-ish +git+ssh://user@hostname:project.git#commit-ish +git+http://user@hostname/project/blah.git#commit-ish +git+https://user@hostname/project/blah.git#commit-ish</code></pre> + +<p>The <code>commit-ish</code> can be any tag, sha, or branch which can be supplied as +an argument to <code>git checkout</code>. The default is <code>master</code>.</p> + +<h2 id="What-is-a-module">What is a <code>module</code>?</h2> + +<p>A module is anything that can be loaded with <code>require()</code> in a Node.js +program. The following things are all examples of things that can be +loaded as modules:</p> + +<ul><li>A folder with a <code>package.json</code> file containing a <code>main</code> field.</li><li>A folder with an <code>index.js</code> file in it.</li><li>A JavaScript file.</li></ul> + +<p>Most npm packages are modules, because they are libraries that you +load with <code>require</code>. However, there's no requirement that an npm +package be a module! Some only contain an executable command-line +interface, and don't provide a <code>main</code> field for use in Node programs.</p> + +<p>Almost all npm packages (at least, those that are Node programs) +<em>contain</em> many modules within them (because every file they load with +<code>require()</code> is a module).</p> + +<p>In the context of a Node program, the <code>module</code> is also the thing that +was loaded <em>from</em> a file. For example, in the following program:</p> + +<pre><code>var req = require('request')</code></pre> + +<p>we might say that "The variable <code>req</code> refers to the <code>request</code> module".</p> + +<h2 id="So-why-is-it-the-node_modules-folder-but-package-json-file-Why-not-node_packages-or-module-json">So, why is it the "<code>node_modules</code>" folder, but "<code>package.json</code>" file? Why not <code>node_packages</code> or <code>module.json</code>?</h2> + +<p>The <code>package.json</code> file defines the package. (See "What is a +package?" above.)</p> + +<p>The <code>node_modules</code> folder is the place Node.js looks for modules. +(See "What is a module?" above.)</p> + +<p>For example, if you create a file at <code>node_modules/foo.js</code> and then +had a program that did <code>var f = require('foo.js')</code> then it would load +the module. However, <code>foo.js</code> is not a "package" in this case, +because it does not have a package.json.</p> + +<p>Alternatively, if you create a package which does not have an +<code>index.js</code> or a <code>"main"</code> field in the <code>package.json</code> file, then it is +not a module. Even if it's installed in <code>node_modules</code>, it can't be +an argument to <code>require()</code>.</p> + +<h2 id="node_modules-is-the-name-of-my-deity-s-arch-rival-and-a-Forbidden-Word-in-my-religion-Can-I-configure-npm-to-use-a-different-folder"><code>"node_modules"</code> is the name of my deity's arch-rival, and a Forbidden Word in my religion. Can I configure npm to use a different folder?</h2> + +<p>No. This will never happen. This question comes up sometimes, +because it seems silly from the outside that npm couldn't just be +configured to put stuff somewhere else, and then npm could load them +from there. It's an arbitrary spelling choice, right? What's the big +deal?</p> + +<p>At the time of this writing, the string <code>'node_modules'</code> appears 151 +times in 53 separate files in npm and node core (excluding tests and +documentation).</p> + +<p>Some of these references are in node's built-in module loader. Since +npm is not involved <strong>at all</strong> at run-time, node itself would have to +be configured to know where you've decided to stick stuff. Complexity +hurdle #1. Since the Node module system is locked, this cannot be +changed, and is enough to kill this request. But I'll continue, in +deference to your deity's delicate feelings regarding spelling.</p> + +<p>Many of the others are in dependencies that npm uses, which are not +necessarily tightly coupled to npm (in the sense that they do not read +npm's configuration files, etc.) Each of these would have to be +configured to take the name of the <code>node_modules</code> folder as a +parameter. Complexity hurdle #2.</p> + +<p>Furthermore, npm has the ability to "bundle" dependencies by adding +the dep names to the <code>"bundledDependencies"</code> list in package.json, +which causes the folder to be included in the package tarball. What +if the author of a module bundles its dependencies, and they use a +different spelling for <code>node_modules</code>? npm would have to rename the +folder at publish time, and then be smart enough to unpack it using +your locally configured name. Complexity hurdle #3.</p> + +<p>Furthermore, what happens when you <em>change</em> this name? Fine, it's +easy enough the first time, just rename the <code>node_modules</code> folders to +<code>./blergyblerp/</code> or whatever name you choose. But what about when you +change it again? npm doesn't currently track any state about past +configuration settings, so this would be rather difficult to do +properly. It would have to track every previous value for this +config, and always accept any of them, or else yesterday's install may +be broken tomorrow. Complexity hurdle #5.</p> + +<p>Never going to happen. The folder is named <code>node_modules</code>. It is +written indelibly in the Node Way, handed down from the ancient times +of Node 0.3.</p> + +<h2 id="How-do-I-install-node-with-npm">How do I install node with npm?</h2> + +<p>You don't. Try one of these node version managers:</p> + +<p>Unix:</p> + +<ul><li><a href="http://github.com/isaacs/nave">http://github.com/isaacs/nave</a></li><li><a href="http://github.com/visionmedia/n">http://github.com/visionmedia/n</a></li><li><a href="http://github.com/creationix/nvm">http://github.com/creationix/nvm</a></li></ul> + +<p>Windows:</p> + +<ul><li><a href="http://github.com/marcelklehr/nodist">http://github.com/marcelklehr/nodist</a></li><li><a href="https://github.com/hakobera/nvmw">https://github.com/hakobera/nvmw</a></li></ul> + +<h2 id="How-can-I-use-npm-for-development">How can I use npm for development?</h2> + +<p>See <code><a href="../misc/npm-developers.html">npm-developers(7)</a></code> and <code><a href="../files/package.json.html">package.json(5)</a></code>.</p> + +<p>You'll most likely want to <code>npm link</code> your development folder. That's +awesomely handy.</p> + +<p>To set up your own private registry, check out <code><a href="../misc/npm-registry.html">npm-registry(7)</a></code>.</p> + +<h2 id="Can-I-list-a-url-as-a-dependency">Can I list a url as a dependency?</h2> + +<p>Yes. It should be a url to a gzipped tarball containing a single folder +that has a package.json in its root, or a git url. +(See "what is a package?" above.)</p> + +<h2 id="How-do-I-symlink-to-a-dev-folder-so-I-don-t-have-to-keep-re-installing">How do I symlink to a dev folder so I don't have to keep re-installing?</h2> + +<p>See <code><a href="../cli/npm-link.html">npm-link(1)</a></code></p> + +<h2 id="The-package-registry-website-What-is-that-exactly">The package registry website. What is that exactly?</h2> + +<p>See <code><a href="../misc/npm-registry.html">npm-registry(7)</a></code>.</p> + +<h2 id="I-forgot-my-password-and-can-t-publish-How-do-I-reset-it">I forgot my password, and can't publish. How do I reset it?</h2> + +<p>Go to <a href="https://npmjs.org/forgot">https://npmjs.org/forgot</a>.</p> + +<h2 id="I-get-ECONNREFUSED-a-lot-What-s-up">I get ECONNREFUSED a lot. What's up?</h2> + +<p>Either the registry is down, or node's DNS isn't able to reach out.</p> + +<p>To check if the registry is down, open up <a href="http://registry.npmjs.org/">http://registry.npmjs.org/</a> +in a web browser. This will also tell you if you are just unable to +access the internet for some reason.</p> + +<p>If the registry IS down, let me know by emailing <a href="mailto:i@izs.me">i@izs.me</a> or posting +an issue at <a href="https://github.com/isaacs/npm/issues">https://github.com/isaacs/npm/issues</a>. We'll have +someone kick it or something.</p> + +<h2 id="Why-no-namespaces">Why no namespaces?</h2> + +<p>Please see this discussion: <a href="https://github.com/isaacs/npm/issues/798">https://github.com/isaacs/npm/issues/798</a></p> + +<p>tl;dr - It doesn't actually make things better, and can make them worse.</p> + +<p>If you want to namespace your own packages, you may: simply use the +<code>-</code> character to separate the names. npm is a mostly anarchic system. +There is not sufficient need to impose namespace rules on everyone.</p> + +<h2 id="Who-does-npm">Who does npm?</h2> + +<p><code>npm view npm author</code></p> + +<p><code>npm view npm contributors</code></p> + +<h2 id="I-have-a-question-or-request-not-addressed-here-Where-should-I-put-it">I have a question or request not addressed here. Where should I put it?</h2> + +<p>Post an issue on the github project:</p> + +<ul><li><a href="https://github.com/isaacs/npm/issues">https://github.com/isaacs/npm/issues</a></li></ul> + +<h2 id="Why-does-npm-hate-me">Why does npm hate me?</h2> + +<p>npm is not capable of hatred. It loves everyone, especially you.</p> + +<h2 id="SEE-ALSO">SEE ALSO</h2> + +<ul><li><a href="../cli/npm.html">npm(1)</a></li><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li></ul> +</div> +<p id="footer">npm-faq — npm@1.3.3</p> +<script> +;(function () { +var wrapper = document.getElementById("wrapper") +var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) + .filter(function (el) { + return el.parentNode === wrapper + && el.tagName.match(/H[1-6]/) + && el.id + }) +var l = 2 + , toc = document.createElement("ul") +toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + , out = "" + while (i > l) { + out += "<ul>" + l ++ + } + while (i < l) { + out += "</ul>" + l -- + } + out += "<li><a href='#" + el.id + "'>" + + ( el.innerText || el.text || el.innerHTML) + + "</a>" + return out +}).join("\n") +toc.id = "toc" +document.body.appendChild(toc) +})() +</script> diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html new file mode 100644 index 0000000000..fb768c3e08 --- /dev/null +++ b/deps/npm/html/doc/misc/npm-index.html @@ -0,0 +1,442 @@ +<!doctype html> +<html> + <title>npm-index</title> + <meta http-equiv="content-type" value="text/html;utf-8"> + <link rel="stylesheet" type="text/css" href="../../static/style.css"> + + <body> + <div id="wrapper"> +<h1><a href="../misc/npm-index.html">npm-index</a></h1> <p>Index of all npm documentation</p> + +<h2 id="README-1"><a href="../../doc/README.html">README</a></h2> + +<p>node package manager</p> + +<h1>Command Line Documentation</h1> + +<h2 id="npm-1"><a href="../cli/npm.html">npm(1)</a></h2> + +<p>node package manager</p> + +<h2 id="npm-adduser-1"><a href="../cli/npm-adduser.html">npm-adduser(1)</a></h2> + +<p>Add a registry user account</p> + +<h2 id="npm-bin-1"><a href="../cli/npm-bin.html">npm-bin(1)</a></h2> + +<p>Display npm bin folder</p> + +<h2 id="npm-bugs-1"><a href="../cli/npm-bugs.html">npm-bugs(1)</a></h2> + +<p>Bugs for a package in a web browser maybe</p> + +<h2 id="npm-build-1"><a href="../cli/npm-build.html">npm-build(1)</a></h2> + +<p>Build a package</p> + +<h2 id="npm-bundle-1"><a href="../cli/npm-bundle.html">npm-bundle(1)</a></h2> + +<p>REMOVED</p> + +<h2 id="npm-cache-1"><a href="../cli/npm-cache.html">npm-cache(1)</a></h2> + +<p>Manipulates packages cache</p> + +<h2 id="npm-completion-1"><a href="../cli/npm-completion.html">npm-completion(1)</a></h2> + +<p>Tab Completion for npm</p> + +<h2 id="npm-config-1"><a href="../cli/npm-config.html">npm-config(1)</a></h2> + +<p>Manage the npm configuration files</p> + +<h2 id="npm-dedupe-1"><a href="../cli/npm-dedupe.html">npm-dedupe(1)</a></h2> + +<p>Reduce duplication</p> + +<h2 id="npm-deprecate-1"><a href="../cli/npm-deprecate.html">npm-deprecate(1)</a></h2> + +<p>Deprecate a version of a package</p> + +<h2 id="npm-docs-1"><a href="../cli/npm-docs.html">npm-docs(1)</a></h2> + +<p>Docs for a package in a web browser maybe</p> + +<h2 id="npm-edit-1"><a href="../cli/npm-edit.html">npm-edit(1)</a></h2> + +<p>Edit an installed package</p> + +<h2 id="npm-explore-1"><a href="../cli/npm-explore.html">npm-explore(1)</a></h2> + +<p>Browse an installed package</p> + +<h2 id="npm-help-search-1"><a href="../cli/npm-help-search.html">npm-help-search(1)</a></h2> + +<p>Search npm help documentation</p> + +<h2 id="npm-help-1"><a href="../cli/npm-help.html">npm-help(1)</a></h2> + +<p>Get help on npm</p> + +<h2 id="npm-init-1"><a href="../cli/npm-init.html">npm-init(1)</a></h2> + +<p>Interactively create a package.json file</p> + +<h2 id="npm-install-1"><a href="../cli/npm-install.html">npm-install(1)</a></h2> + +<p>Install a package</p> + +<h2 id="npm-link-1"><a href="../cli/npm-link.html">npm-link(1)</a></h2> + +<p>Symlink a package folder</p> + +<h2 id="npm-ls-1"><a href="../cli/npm-ls.html">npm-ls(1)</a></h2> + +<p>List installed packages</p> + +<h2 id="npm-outdated-1"><a href="../cli/npm-outdated.html">npm-outdated(1)</a></h2> + +<p>Check for outdated packages</p> + +<h2 id="npm-owner-1"><a href="../cli/npm-owner.html">npm-owner(1)</a></h2> + +<p>Manage package owners</p> + +<h2 id="npm-pack-1"><a href="../cli/npm-pack.html">npm-pack(1)</a></h2> + +<p>Create a tarball from a package</p> + +<h2 id="npm-prefix-1"><a href="../cli/npm-prefix.html">npm-prefix(1)</a></h2> + +<p>Display prefix</p> + +<h2 id="npm-prune-1"><a href="../cli/npm-prune.html">npm-prune(1)</a></h2> + +<p>Remove extraneous packages</p> + +<h2 id="npm-publish-1"><a href="../cli/npm-publish.html">npm-publish(1)</a></h2> + +<p>Publish a package</p> + +<h2 id="npm-rebuild-1"><a href="../cli/npm-rebuild.html">npm-rebuild(1)</a></h2> + +<p>Rebuild a package</p> + +<h2 id="npm-restart-1"><a href="../cli/npm-restart.html">npm-restart(1)</a></h2> + +<p>Start a package</p> + +<h2 id="npm-rm-1"><a href="../cli/npm-rm.html">npm-rm(1)</a></h2> + +<p>Remove a package</p> + +<h2 id="npm-root-1"><a href="../cli/npm-root.html">npm-root(1)</a></h2> + +<p>Display npm root</p> + +<h2 id="npm-run-script-1"><a href="../cli/npm-run-script.html">npm-run-script(1)</a></h2> + +<p>Run arbitrary package scripts</p> + +<h2 id="npm-search-1"><a href="../cli/npm-search.html">npm-search(1)</a></h2> + +<p>Search for packages</p> + +<h2 id="npm-shrinkwrap-1"><a href="../cli/npm-shrinkwrap.html">npm-shrinkwrap(1)</a></h2> + +<p>Lock down dependency versions</p> + +<h2 id="npm-star-1"><a href="../cli/npm-star.html">npm-star(1)</a></h2> + +<p>Mark your favorite packages</p> + +<h2 id="npm-stars-1"><a href="../cli/npm-stars.html">npm-stars(1)</a></h2> + +<p>View packages marked as favorites</p> + +<h2 id="npm-start-1"><a href="../cli/npm-start.html">npm-start(1)</a></h2> + +<p>Start a package</p> + +<h2 id="npm-stop-1"><a href="../cli/npm-stop.html">npm-stop(1)</a></h2> + +<p>Stop a package</p> + +<h2 id="npm-submodule-1"><a href="../cli/npm-submodule.html">npm-submodule(1)</a></h2> + +<p>Add a package as a git submodule</p> + +<h2 id="npm-tag-1"><a href="../cli/npm-tag.html">npm-tag(1)</a></h2> + +<p>Tag a published version</p> + +<h2 id="npm-test-1"><a href="../cli/npm-test.html">npm-test(1)</a></h2> + +<p>Test a package</p> + +<h2 id="npm-uninstall-1"><a href="../cli/npm-uninstall.html">npm-uninstall(1)</a></h2> + +<p>Remove a package</p> + +<h2 id="npm-unpublish-1"><a href="../cli/npm-unpublish.html">npm-unpublish(1)</a></h2> + +<p>Remove a package from the registry</p> + +<h2 id="npm-update-1"><a href="../cli/npm-update.html">npm-update(1)</a></h2> + +<p>Update a package</p> + +<h2 id="npm-version-1"><a href="../cli/npm-version.html">npm-version(1)</a></h2> + +<p>Bump a package version</p> + +<h2 id="npm-view-1"><a href="../cli/npm-view.html">npm-view(1)</a></h2> + +<p>View registry info</p> + +<h2 id="npm-whoami-1"><a href="../cli/npm-whoami.html">npm-whoami(1)</a></h2> + +<p>Display npm username</p> + +<h1>API Documentation</h1> + +<h2 id="npm-3"><a href="../api/npm.html">npm(3)</a></h2> + +<p>node package manager</p> + +<h2 id="npm-bin-3"><a href="../api/npm-bin.html">npm-bin(3)</a></h2> + +<p>Display npm bin folder</p> + +<h2 id="npm-bugs-3"><a href="../api/npm-bugs.html">npm-bugs(3)</a></h2> + +<p>Bugs for a package in a web browser maybe</p> + +<h2 id="npm-commands-3"><a href="../api/npm-commands.html">npm-commands(3)</a></h2> + +<p>npm commands</p> + +<h2 id="npm-config-3"><a href="../api/npm-config.html">npm-config(3)</a></h2> + +<p>Manage the npm configuration files</p> + +<h2 id="npm-deprecate-3"><a href="../api/npm-deprecate.html">npm-deprecate(3)</a></h2> + +<p>Deprecate a version of a package</p> + +<h2 id="npm-docs-3"><a href="../api/npm-docs.html">npm-docs(3)</a></h2> + +<p>Docs for a package in a web browser maybe</p> + +<h2 id="npm-edit-3"><a href="../api/npm-edit.html">npm-edit(3)</a></h2> + +<p>Edit an installed package</p> + +<h2 id="npm-explore-3"><a href="../api/npm-explore.html">npm-explore(3)</a></h2> + +<p>Browse an installed package</p> + +<h2 id="npm-help-search-3"><a href="../api/npm-help-search.html">npm-help-search(3)</a></h2> + +<p>Search the help pages</p> + +<h2 id="npm-init-3"><a href="../api/npm-init.html">npm-init(3)</a></h2> + +<p>Interactively create a package.json file</p> + +<h2 id="npm-install-3"><a href="../api/npm-install.html">npm-install(3)</a></h2> + +<p>install a package programmatically</p> + +<h2 id="npm-link-3"><a href="../api/npm-link.html">npm-link(3)</a></h2> + +<p>Symlink a package folder</p> + +<h2 id="npm-load-3"><a href="../api/npm-load.html">npm-load(3)</a></h2> + +<p>Load config settings</p> + +<h2 id="npm-ls-3"><a href="../api/npm-ls.html">npm-ls(3)</a></h2> + +<p>List installed packages</p> + +<h2 id="npm-outdated-3"><a href="../api/npm-outdated.html">npm-outdated(3)</a></h2> + +<p>Check for outdated packages</p> + +<h2 id="npm-owner-3"><a href="../api/npm-owner.html">npm-owner(3)</a></h2> + +<p>Manage package owners</p> + +<h2 id="npm-pack-3"><a href="../api/npm-pack.html">npm-pack(3)</a></h2> + +<p>Create a tarball from a package</p> + +<h2 id="npm-prefix-3"><a href="../api/npm-prefix.html">npm-prefix(3)</a></h2> + +<p>Display prefix</p> + +<h2 id="npm-prune-3"><a href="../api/npm-prune.html">npm-prune(3)</a></h2> + +<p>Remove extraneous packages</p> + +<h2 id="npm-publish-3"><a href="../api/npm-publish.html">npm-publish(3)</a></h2> + +<p>Publish a package</p> + +<h2 id="npm-rebuild-3"><a href="../api/npm-rebuild.html">npm-rebuild(3)</a></h2> + +<p>Rebuild a package</p> + +<h2 id="npm-restart-3"><a href="../api/npm-restart.html">npm-restart(3)</a></h2> + +<p>Start a package</p> + +<h2 id="npm-root-3"><a href="../api/npm-root.html">npm-root(3)</a></h2> + +<p>Display npm root</p> + +<h2 id="npm-run-script-3"><a href="../api/npm-run-script.html">npm-run-script(3)</a></h2> + +<p>Run arbitrary package scripts</p> + +<h2 id="npm-search-3"><a href="../api/npm-search.html">npm-search(3)</a></h2> + +<p>Search for packages</p> + +<h2 id="npm-shrinkwrap-3"><a href="../api/npm-shrinkwrap.html">npm-shrinkwrap(3)</a></h2> + +<p>programmatically generate package shrinkwrap file</p> + +<h2 id="npm-start-3"><a href="../api/npm-start.html">npm-start(3)</a></h2> + +<p>Start a package</p> + +<h2 id="npm-stop-3"><a href="../api/npm-stop.html">npm-stop(3)</a></h2> + +<p>Stop a package</p> + +<h2 id="npm-submodule-3"><a href="../api/npm-submodule.html">npm-submodule(3)</a></h2> + +<p>Add a package as a git submodule</p> + +<h2 id="npm-tag-3"><a href="../api/npm-tag.html">npm-tag(3)</a></h2> + +<p>Tag a published version</p> + +<h2 id="npm-test-3"><a href="../api/npm-test.html">npm-test(3)</a></h2> + +<p>Test a package</p> + +<h2 id="npm-uninstall-3"><a href="../api/npm-uninstall.html">npm-uninstall(3)</a></h2> + +<p>uninstall a package programmatically</p> + +<h2 id="npm-unpublish-3"><a href="../api/npm-unpublish.html">npm-unpublish(3)</a></h2> + +<p>Remove a package from the registry</p> + +<h2 id="npm-update-3"><a href="../api/npm-update.html">npm-update(3)</a></h2> + +<p>Update a package</p> + +<h2 id="npm-version-3"><a href="../api/npm-version.html">npm-version(3)</a></h2> + +<p>Bump a package version</p> + +<h2 id="npm-view-3"><a href="../api/npm-view.html">npm-view(3)</a></h2> + +<p>View registry info</p> + +<h2 id="npm-whoami-3"><a href="../api/npm-whoami.html">npm-whoami(3)</a></h2> + +<p>Display npm username</p> + +<h1>Files</h1> + +<h2 id="npm-folders-5"><a href="../files/npm-folders.html">npm-folders(5)</a></h2> + +<p>Folder Structures Used by npm</p> + +<h2 id="npmrc-5"><a href="../files/npmrc.html">npmrc(5)</a></h2> + +<p>The npm config files</p> + +<h2 id="package-json-5"><a href="../files/package.json.html">package.json(5)</a></h2> + +<p>Specifics of npm's package.json handling</p> + +<h1>Misc</h1> + +<h2 id="npm-coding-style-7"><a href="../misc/npm-coding-style.html">npm-coding-style(7)</a></h2> + +<p>npm's "funny" coding style</p> + +<h2 id="npm-config-7"><a href="../misc/npm-config.html">npm-config(7)</a></h2> + +<p>More than you probably want to know about npm configuration</p> + +<h2 id="npm-developers-7"><a href="../misc/npm-developers.html">npm-developers(7)</a></h2> + +<p>Developer Guide</p> + +<h2 id="npm-disputes-7"><a href="../misc/npm-disputes.html">npm-disputes(7)</a></h2> + +<p>Handling Module Name Disputes</p> + +<h2 id="npm-faq-7"><a href="../misc/npm-faq.html">npm-faq(7)</a></h2> + +<p>Frequently Asked Questions</p> + +<h2 id="npm-index-7"><a href="../misc/npm-index.html">npm-index(7)</a></h2> + +<p>Index of all npm documentation</p> + +<h2 id="npm-registry-7"><a href="../misc/npm-registry.html">npm-registry(7)</a></h2> + +<p>The JavaScript Package Registry</p> + +<h2 id="npm-scripts-7"><a href="../misc/npm-scripts.html">npm-scripts(7)</a></h2> + +<p>How npm handles the "scripts" field</p> + +<h2 id="removing-npm-7"><a href="../misc/removing-npm.html">removing-npm(7)</a></h2> + +<p>Cleaning the Slate</p> + +<h2 id="semver-7"><a href="../misc/semver.html">semver(7)</a></h2> + +<p>The semantic versioner for npm</p> +</div> +<p id="footer">npm-index — npm@1.3.3</p> +<script> +;(function () { +var wrapper = document.getElementById("wrapper") +var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) + .filter(function (el) { + return el.parentNode === wrapper + && el.tagName.match(/H[1-6]/) + && el.id + }) +var l = 2 + , toc = document.createElement("ul") +toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + , out = "" + while (i > l) { + out += "<ul>" + l ++ + } + while (i < l) { + out += "</ul>" + l -- + } + out += "<li><a href='#" + el.id + "'>" + + ( el.innerText || el.text || el.innerHTML) + + "</a>" + return out +}).join("\n") +toc.id = "toc" +document.body.appendChild(toc) +})() +</script> diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html new file mode 100644 index 0000000000..4f6392d5c8 --- /dev/null +++ b/deps/npm/html/doc/misc/npm-registry.html @@ -0,0 +1,130 @@ +<!doctype html> +<html> + <title>npm-registry</title> + <meta http-equiv="content-type" value="text/html;utf-8"> + <link rel="stylesheet" type="text/css" href="../../static/style.css"> + + <body> + <div id="wrapper"> +<h1><a href="../misc/npm-registry.html">npm-registry</a></h1> <p>The JavaScript Package Registry</p> + +<h2 id="DESCRIPTION">DESCRIPTION</h2> + +<p>To resolve packages by name and version, npm talks to a registry website +that implements the CommonJS Package Registry specification for reading +package info.</p> + +<p>Additionally, npm's package registry implementation supports several +write APIs as well, to allow for publishing packages and managing user +account information.</p> + +<p>The official public npm registry is at <a href="http://registry.npmjs.org/">http://registry.npmjs.org/</a>. It +is powered by a CouchDB database at +<a href="http://isaacs.iriscouch.com/registry">http://isaacs.iriscouch.com/registry</a>. The code for the couchapp is +available at <a href="http://github.com/isaacs/npmjs.org">http://github.com/isaacs/npmjs.org</a>. npm user accounts +are CouchDB users, stored in the <a href="http://isaacs.iriscouch.com/_users">http://isaacs.iriscouch.com/_users</a> +database.</p> + +<p>The registry URL is supplied by the <code>registry</code> config parameter. See +<code><a href="../cli/npm-config.html">npm-config(1)</a></code>, <code><a href="../files/npmrc.html">npmrc(5)</a></code>, and <code><a href="../misc/npm-config.html">npm-config(7)</a></code> for more on managing +npm's configuration.</p> + +<h2 id="Can-I-run-my-own-private-registry">Can I run my own private registry?</h2> + +<p>Yes!</p> + +<p>The easiest way is to replicate the couch database, and use the same (or +similar) design doc to implement the APIs.</p> + +<p>If you set up continuous replication from the official CouchDB, and then +set your internal CouchDB as the registry config, then you'll be able +to read any published packages, in addition to your private ones, and by +default will only publish internally. If you then want to publish a +package for the whole world to see, you can simply override the +<code>--registry</code> config for that command.</p> + +<h2 id="I-don-t-want-my-package-published-in-the-official-registry-It-s-private">I don't want my package published in the official registry. It's private.</h2> + +<p>Set <code>"private": true</code> in your package.json to prevent it from being +published at all, or +<code>"publishConfig":{"registry":"http://my-internal-registry.local"}</code> +to force it to be published only to your internal registry.</p> + +<p>See <code><a href="../files/package.json.html">package.json(5)</a></code> for more info on what goes in the package.json file.</p> + +<h2 id="Will-you-replicate-from-my-registry-into-the-public-one">Will you replicate from my registry into the public one?</h2> + +<p>No. If you want things to be public, then publish them into the public +registry using npm. What little security there is would be for nought +otherwise.</p> + +<h2 id="Do-I-have-to-use-couchdb-to-build-a-registry-that-npm-can-talk-to">Do I have to use couchdb to build a registry that npm can talk to?</h2> + +<p>No, but it's way easier.</p> + +<h2 id="I-published-something-elsewhere-and-want-to-tell-the-npm-registry-about-it">I published something elsewhere, and want to tell the npm registry about it.</h2> + +<p>That is supported, but not using the npm client. You'll have to get +your hands dirty and do some HTTP. The request looks something like +this:</p> + +<pre><code>PUT /my-foreign-package +content-type:application/json +accept:application/json +authorization:Basic $base_64_encoded + +{ "name":"my-foreign-package" +, "maintainers":["owner","usernames"] +, "description":"A package that is hosted elsewhere" +, "keywords":["nih","my cheese smells the best"] +, "url":"http://my-different-registry.com/blerg/my-local-package" +}</code></pre> + +<p>(Keywords and description are optional, but recommended. Name, +maintainers, and url are required.)</p> + +<p>Then, when a user tries to install "my-foreign-package", it'll redirect +to your registry. If that doesn't resolve to a valid package entry, +then it'll fail, so please make sure that you understand the spec, and +ask for help on the <a href="mailto:npm-@googlegroups.com">npm-@googlegroups.com</a> mailing list.</p> + +<h2 id="Is-there-a-website-or-something-to-see-package-docs-and-such">Is there a website or something to see package docs and such?</h2> + +<p>Yes, head over to <a href="https://npmjs.org/">https://npmjs.org/</a></p> + +<h2 id="SEE-ALSO">SEE ALSO</h2> + +<ul><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../misc/npm-disputes.html">npm-disputes(7)</a></li></ul> +</div> +<p id="footer">npm-registry — npm@1.3.3</p> +<script> +;(function () { +var wrapper = document.getElementById("wrapper") +var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) + .filter(function (el) { + return el.parentNode === wrapper + && el.tagName.match(/H[1-6]/) + && el.id + }) +var l = 2 + , toc = document.createElement("ul") +toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + , out = "" + while (i > l) { + out += "<ul>" + l ++ + } + while (i < l) { + out += "</ul>" + l -- + } + out += "<li><a href='#" + el.id + "'>" + + ( el.innerText || el.text || el.innerHTML) + + "</a>" + return out +}).join("\n") +toc.id = "toc" +document.body.appendChild(toc) +})() +</script> diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html new file mode 100644 index 0000000000..804553288b --- /dev/null +++ b/deps/npm/html/doc/misc/npm-scripts.html @@ -0,0 +1,257 @@ +<!doctype html> +<html> + <title>npm-scripts</title> + <meta http-equiv="content-type" value="text/html;utf-8"> + <link rel="stylesheet" type="text/css" href="../../static/style.css"> + + <body> + <div id="wrapper"> +<h1><a href="../misc/npm-scripts.html">npm-scripts</a></h1> <p>How npm handles the "scripts" field</p> + +<h2 id="DESCRIPTION">DESCRIPTION</h2> + +<p>npm supports the "scripts" member of the package.json script, for the +following scripts:</p> + +<ul><li>prepublish: +Run BEFORE the package is published. (Also run on local <code>npm +install</code> without any arguments.)</li><li>publish, postpublish: +Run AFTER the package is published.</li><li>preinstall: +Run BEFORE the package is installed</li><li>install, postinstall: +Run AFTER the package is installed.</li><li>preuninstall, uninstall: +Run BEFORE the package is uninstalled.</li><li>postuninstall: +Run AFTER the package is uninstalled.</li><li>preupdate: +Run BEFORE the package is updated with the update command.</li><li>update, postupdate: +Run AFTER the package is updated with the update command.</li><li>pretest, test, posttest: +Run by the <code>npm test</code> command.</li><li>prestop, stop, poststop: +Run by the <code>npm stop</code> command.</li><li>prestart, start, poststart: +Run by the <code>npm start</code> command.</li><li>prerestart, restart, postrestart: +Run by the <code>npm restart</code> command. Note: <code>npm restart</code> will run the +stop and start scripts if no <code>restart</code> script is provided.</li></ul> + +<p>Additionally, arbitrary scrips can be run by doing +<code>npm run-script <stage> <pkg></code>.</p> + +<h2 id="NOTE-INSTALL-SCRIPTS-ARE-AN-ANTIPATTERN">NOTE: INSTALL SCRIPTS ARE AN ANTIPATTERN</h2> + +<p><strong>tl;dr</strong> Don't use <code>install</code>. Use a <code>.gyp</code> file for compilation, and +<code>prepublish</code> for anything else.</p> + +<p>You should almost never have to explicitly set a <code>preinstall</code> or +<code>install</code> script. If you are doing this, please consider if there is +another option.</p> + +<p>The only valid use of <code>install</code> or <code>preinstall</code> scripts is for +compilation which must be done on the target architecture. In early +versions of node, this was often done using the <code>node-waf</code> scripts, or +a standalone <code>Makefile</code>, and early versions of npm required that it be +explicitly set in package.json. This was not portable, and harder to +do properly.</p> + +<p>In the current version of node, the standard way to do this is using a +<code>.gyp</code> file. If you have a file with a <code>.gyp</code> extension in the root +of your package, then npm will run the appropriate <code>node-gyp</code> commands +automatically at install time. This is the only officially supported +method for compiling binary addons, and does not require that you add +anything to your package.json file.</p> + +<p>If you have to do other things before your package is used, in a way +that is not dependent on the operating system or architecture of the +target system, then use a <code>prepublish</code> script instead. This includes +tasks such as:</p> + +<ul><li>Compile CoffeeScript source code into JavaScript.</li><li>Create minified versions of JavaScript source code.</li><li>Fetching remote resources that your package will use.</li></ul> + +<p>The advantage of doing these things at <code>prepublish</code> time instead of +<code>preinstall</code> or <code>install</code> time is that they can be done once, in a +single place, and thus greatly reduce complexity and variability. +Additionally, this means that:</p> + +<ul><li>You can depend on <code>coffee-script</code> as a <code>devDependency</code>, and thus +your users don't need to have it installed.</li><li>You don't need to include the minifiers in your package, reducing +the size for your users.</li><li>You don't need to rely on your users having <code>curl</code> or <code>wget</code> or +other system tools on the target machines.</li></ul> + +<h2 id="DEFAULT-VALUES">DEFAULT VALUES</h2> + +<p>npm will default some script values based on package contents.</p> + +<ul><li><p><code>"start": "node server.js"</code>:</p><p>If there is a <code>server.js</code> file in the root of your package, then npm +will default the <code>start</code> command to <code>node server.js</code>.</p></li><li><p><code>"preinstall": "node-waf clean || true; node-waf configure build"</code>:</p><p>If there is a <code>wscript</code> file in the root of your package, npm will +default the <code>preinstall</code> command to compile using node-waf.</p></li></ul> + +<h2 id="USER">USER</h2> + +<p>If npm was invoked with root privileges, then it will change the uid +to the user account or uid specified by the <code>user</code> config, which +defaults to <code>nobody</code>. Set the <code>unsafe-perm</code> flag to run scripts with +root privileges.</p> + +<h2 id="ENVIRONMENT">ENVIRONMENT</h2> + +<p>Package scripts run in an environment where many pieces of information +are made available regarding the setup of npm and the current state of +the process.</p> + +<h3 id="path">path</h3> + +<p>If you depend on modules that define executable scripts, like test +suites, then those executables will be added to the <code>PATH</code> for +executing the scripts. So, if your package.json has this:</p> + +<pre><code>{ "name" : "foo" +, "dependencies" : { "bar" : "0.1.x" } +, "scripts": { "start" : "bar ./test" } }</code></pre> + +<p>then you could run <code>npm start</code> to execute the <code>bar</code> script, which is +exported into the <code>node_modules/.bin</code> directory on <code>npm install</code>.</p> + +<h3 id="package-json-vars">package.json vars</h3> + +<p>The package.json fields are tacked onto the <code>npm_package_</code> prefix. So, +for instance, if you had <code>{"name":"foo", "version":"1.2.5"}</code> in your +package.json file, then your package scripts would have the +<code>npm_package_name</code> environment variable set to "foo", and the +<code>npm_package_version</code> set to "1.2.5"</p> + +<h3 id="configuration">configuration</h3> + +<p>Configuration parameters are put in the environment with the +<code>npm_config_</code> prefix. For instance, you can view the effective <code>root</code> +config by checking the <code>npm_config_root</code> environment variable.</p> + +<h3 id="Special-package-json-config-hash">Special: package.json "config" hash</h3> + +<p>The package.json "config" keys are overwritten in the environment if +there is a config param of <code><name>[@<version>]:<key></code>. For example, +if the package.json has this:</p> + +<pre><code>{ "name" : "foo" +, "config" : { "port" : "8080" } +, "scripts" : { "start" : "node server.js" } }</code></pre> + +<p>and the server.js is this:</p> + +<pre><code>http.createServer(...).listen(process.env.npm_package_config_port)</code></pre> + +<p>then the user could change the behavior by doing:</p> + +<pre><code>npm config set foo:port 80</code></pre> + +<h3 id="current-lifecycle-event">current lifecycle event</h3> + +<p>Lastly, the <code>npm_lifecycle_event</code> environment variable is set to +whichever stage of the cycle is being executed. So, you could have a +single script used for different parts of the process which switches +based on what's currently happening.</p> + +<p>Objects are flattened following this format, so if you had +<code>{"scripts":{"install":"foo.js"}}</code> in your package.json, then you'd +see this in the script:</p> + +<pre><code>process.env.npm_package_scripts_install === "foo.js"</code></pre> + +<h2 id="EXAMPLES">EXAMPLES</h2> + +<p>For example, if your package.json contains this:</p> + +<pre><code>{ "scripts" : + { "install" : "scripts/install.js" + , "postinstall" : "scripts/install.js" + , "uninstall" : "scripts/uninstall.js" + } +}</code></pre> + +<p>then the <code>scripts/install.js</code> will be called for the install, +post-install, stages of the lifecycle, and the <code>scripts/uninstall.js</code> +would be called when the package is uninstalled. Since +<code>scripts/install.js</code> is running for three different phases, it would +be wise in this case to look at the <code>npm_lifecycle_event</code> environment +variable.</p> + +<p>If you want to run a make command, you can do so. This works just +fine:</p> + +<pre><code>{ "scripts" : + { "preinstall" : "./configure" + , "install" : "make && make install" + , "test" : "make test" + } +}</code></pre> + +<h2 id="EXITING">EXITING</h2> + +<p>Scripts are run by passing the line as a script argument to <code>sh</code>.</p> + +<p>If the script exits with a code other than 0, then this will abort the +process.</p> + +<p>Note that these script files don't have to be nodejs or even +javascript programs. They just have to be some kind of executable +file.</p> + +<h2 id="HOOK-SCRIPTS">HOOK SCRIPTS</h2> + +<p>If you want to run a specific script at a specific lifecycle event for +ALL packages, then you can use a hook script.</p> + +<p>Place an executable file at <code>node_modules/.hooks/{eventname}</code>, and +it'll get run for all packages when they are going through that point +in the package lifecycle for any packages installed in that root.</p> + +<p>Hook scripts are run exactly the same way as package.json scripts. +That is, they are in a separate child process, with the env described +above.</p> + +<h2 id="BEST-PRACTICES">BEST PRACTICES</h2> + +<ul><li>Don't exit with a non-zero error code unless you <em>really</em> mean it. +Except for uninstall scripts, this will cause the npm action to +fail, and potentially be rolled back. If the failure is minor or +only will prevent some optional features, then it's better to just +print a warning and exit successfully.</li><li>Try not to use scripts to do what npm can do for you. Read through +<code><a href="../files/package.json.html">package.json(5)</a></code> to see all the things that you can specify and enable +by simply describing your package appropriately. In general, this +will lead to a more robust and consistent state.</li><li>Inspect the env to determine where to put things. For instance, if +the <code>npm_config_binroot</code> environ is set to <code>/home/user/bin</code>, then +don't try to install executables into <code>/usr/local/bin</code>. The user +probably set it up that way for a reason.</li><li>Don't prefix your script commands with "sudo". If root permissions +are required for some reason, then it'll fail with that error, and +the user will sudo the npm command in question.</li></ul> + +<h2 id="SEE-ALSO">SEE ALSO</h2> + +<ul><li><a href="../cli/npm-run-script.html">npm-run-script(1)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul> +</div> +<p id="footer">npm-scripts — npm@1.3.3</p> +<script> +;(function () { +var wrapper = document.getElementById("wrapper") +var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) + .filter(function (el) { + return el.parentNode === wrapper + && el.tagName.match(/H[1-6]/) + && el.id + }) +var l = 2 + , toc = document.createElement("ul") +toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + , out = "" + while (i > l) { + out += "<ul>" + l ++ + } + while (i < l) { + out += "</ul>" + l -- + } + out += "<li><a href='#" + el.id + "'>" + + ( el.innerText || el.text || el.innerHTML) + + "</a>" + return out +}).join("\n") +toc.id = "toc" +document.body.appendChild(toc) +})() +</script> diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html new file mode 100644 index 0000000000..952dc79307 --- /dev/null +++ b/deps/npm/html/doc/misc/removing-npm.html @@ -0,0 +1,92 @@ +<!doctype html> +<html> + <title>removing-npm</title> + <meta http-equiv="content-type" value="text/html;utf-8"> + <link rel="stylesheet" type="text/css" href="../../static/style.css"> + + <body> + <div id="wrapper"> +<h1><a href="../cli/npm-removal.html">npm-removal</a></h1> <p>Cleaning the Slate</p> + +<h2 id="SYNOPSIS">SYNOPSIS</h2> + +<p>So sad to see you go.</p> + +<pre><code>sudo npm uninstall npm -g</code></pre> + +<p>Or, if that fails, get the npm source code, and do:</p> + +<pre><code>sudo make uninstall</code></pre> + +<h2 id="More-Severe-Uninstalling">More Severe Uninstalling</h2> + +<p>Usually, the above instructions are sufficient. That will remove +npm, but leave behind anything you've installed.</p> + +<p>If that doesn't work, or if you require more drastic measures, +continue reading.</p> + +<p>Note that this is only necessary for globally-installed packages. Local +installs are completely contained within a project's <code>node_modules</code> +folder. Delete that folder, and everything is gone (unless a package's +install script is particularly ill-behaved).</p> + +<p>This assumes that you installed node and npm in the default place. If +you configured node with a different <code>--prefix</code>, or installed npm with a +different prefix setting, then adjust the paths accordingly, replacing +<code>/usr/local</code> with your install prefix.</p> + +<p>To remove everything npm-related manually:</p> + +<pre><code>rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*</code></pre> + +<p>If you installed things <em>with</em> npm, then your best bet is to uninstall +them with npm first, and then install them again once you have a +proper install. This can help find any symlinks that are lying +around:</p> + +<pre><code>ls -laF /usr/local/{lib/node{,/.npm},bin,share/man} | grep npm</code></pre> + +<p>Prior to version 0.3, npm used shim files for executables and node +modules. To track those down, you can do the following:</p> + +<pre><code>find /usr/local/{lib/node,bin} -exec grep -l npm \{\} \; ;</code></pre> + +<p>(This is also in the <a href="../../doc/README.html">README</a> file.)</p> + +<h2 id="SEE-ALSO">SEE ALSO</h2> + +<ul><li><a href="../../doc/README.html">README</a></li><li><a href="../cli/npm-rm.html">npm-rm(1)</a></li><li><a href="../cli/npm-prune.html">npm-prune(1)</a></li></ul> +</div> +<p id="footer">removing-npm — npm@1.3.3</p> +<script> +;(function () { +var wrapper = document.getElementById("wrapper") +var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) + .filter(function (el) { + return el.parentNode === wrapper + && el.tagName.match(/H[1-6]/) + && el.id + }) +var l = 2 + , toc = document.createElement("ul") +toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + , out = "" + while (i > l) { + out += "<ul>" + l ++ + } + while (i < l) { + out += "</ul>" + l -- + } + out += "<li><a href='#" + el.id + "'>" + + ( el.innerText || el.text || el.innerHTML) + + "</a>" + return out +}).join("\n") +toc.id = "toc" +document.body.appendChild(toc) +})() +</script> diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html new file mode 100644 index 0000000000..19db6e16c9 --- /dev/null +++ b/deps/npm/html/doc/misc/semver.html @@ -0,0 +1,128 @@ +<!doctype html> +<html> + <title>semver</title> + <meta http-equiv="content-type" value="text/html;utf-8"> + <link rel="stylesheet" type="text/css" href="../../static/style.css"> + + <body> + <div id="wrapper"> +<h1><a href="../misc/semver.html">semver</a></h1> <p>The semantic versioner for npm</p> + +<h2 id="Usage">Usage</h2> + +<pre><code>$ npm install semver + +semver.valid('1.2.3') // '1.2.3' +semver.valid('a.b.c') // null +semver.clean(' =v1.2.3 ') // '1.2.3' +semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true +semver.gt('1.2.3', '9.8.7') // false +semver.lt('1.2.3', '9.8.7') // true</code></pre> + +<p>As a command-line utility:</p> + +<pre><code>$ semver -h + +Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | -d <dec>] +Test if version(s) satisfy the supplied range(s), and sort them. + +Multiple versions or ranges may be supplied, unless increment +or decrement options are specified. In that case, only a single +version may be used, and it is incremented by the specified level + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no versions are valid, or ranges are not satisfied, +then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them.</code></pre> + +<h2 id="Versions">Versions</h2> + +<p>A "version" is described by the v2.0.0 specification found at +<a href="http://semver.org/">http://semver.org/</a>.</p> + +<p>A leading <code>"="</code> or <code>"v"</code> character is stripped off and ignored.</p> + +<h2 id="Ranges">Ranges</h2> + +<p>The following range styles are supported:</p> + +<ul><li><code>1.2.3</code> A specific version. When nothing else will do. Note that +build metadata is still ignored, so <code>1.2.3+build2012</code> will satisfy +this range.</li><li><code>>1.2.3</code> Greater than a specific version.</li><li><code><1.2.3</code> Less than a specific version. If there is no prerelease +tag on the version range, then no prerelease version will be allowed +either, even though these are technically "less than".</li><li><code>>=1.2.3</code> Greater than or equal to. Note that prerelease versions +are NOT equal to their "normal" equivalents, so <code>1.2.3-beta</code> will +not satisfy this range, but <code>2.3.0-beta</code> will.</li><li><code><=1.2.3</code> Less than or equal to. In this case, prerelease versions +ARE allowed, so <code>1.2.3-beta</code> would satisfy.</li><li><code>1.2.3 - 2.3.4</code> := <code>>=1.2.3 <=2.3.4</code></li><li><code>~1.2.3</code> := <code>>=1.2.3-0 <1.3.0-0</code> "Reasonably close to 1.2.3". When +using tilde operators, prerelease versions are supported as well, +but a prerelease of the next significant digit will NOT be +satisfactory, so <code>1.3.0-beta</code> will not satisfy <code>~1.2.3</code>.</li><li><code>~1.2</code> := <code>>=1.2.0-0 <1.3.0-0</code> "Any version starting with 1.2"</li><li><code>1.2.x</code> := <code>>=1.2.0-0 <1.3.0-0</code> "Any version starting with 1.2"</li><li><code>~1</code> := <code>>=1.0.0-0 <2.0.0-0</code> "Any version starting with 1"</li><li><code>1.x</code> := <code>>=1.0.0-0 <2.0.0-0</code> "Any version starting with 1"</li></ul> + +<p>Ranges can be joined with either a space (which implies "and") or a +<code>||</code> (which implies "or").</p> + +<h2 id="Functions">Functions</h2> + +<p>All methods and classes take a final <code>loose</code> boolean argument that, if +true, will be more forgiving about not-quite-valid semver strings. +The resulting output will always be 100% strict, of course.</p> + +<p>Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse.</p> + +<ul><li>valid(v): Return the parsed version, or null if it's not valid.</li><li>inc(v, release): Return the version incremented by the release type +(major, minor, patch, or prerelease), or null if it's not valid.</li></ul> + +<h3 id="Comparison">Comparison</h3> + +<ul><li>gt(v1, v2): <code>v1 > v2</code></li><li>gte(v1, v2): <code>v1 >= v2</code></li><li>lt(v1, v2): <code>v1 < v2</code></li><li>lte(v1, v2): <code>v1 <= v2</code></li><li>eq(v1, v2): <code>v1 == v2</code> This is true if they're logically equivalent, +even if they're not the exact same string. You already know how to +compare strings.</li><li>neq(v1, v2): <code>v1 != v2</code> The opposite of eq.</li><li>cmp(v1, comparator, v2): Pass in a comparison string, and it'll call +the corresponding function above. <code>"==="</code> and <code>"!=="</code> do simple +string comparison, but are included for completeness. Throws if an +invalid comparison string is provided.</li><li>compare(v1, v2): Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if +v2 is greater. Sorts in ascending order if passed to Array.sort().</li><li>rcompare(v1, v2): The reverse of compare. Sorts an array of versions +in descending order when passed to Array.sort().</li></ul> + +<h3 id="Ranges">Ranges</h3> + +<ul><li>validRange(range): Return the valid range or null if it's not valid</li><li>satisfies(version, range): Return true if the version satisfies the +range.</li><li>maxSatisfying(versions, range): Return the highest version in the list +that satisfies the range, or null if none of them do.</li></ul> +</div> +<p id="footer">semver — npm@1.3.3</p> +<script> +;(function () { +var wrapper = document.getElementById("wrapper") +var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) + .filter(function (el) { + return el.parentNode === wrapper + && el.tagName.match(/H[1-6]/) + && el.id + }) +var l = 2 + , toc = document.createElement("ul") +toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + , out = "" + while (i > l) { + out += "<ul>" + l ++ + } + while (i < l) { + out += "</ul>" + l -- + } + out += "<li><a href='#" + el.id + "'>" + + ( el.innerText || el.text || el.innerHTML) + + "</a>" + return out +}).join("\n") +toc.id = "toc" +document.body.appendChild(toc) +})() +</script> |