@ -108,7 +108,7 @@ npm.load(myConfigObject, function (er) {
if (er) return commandFailed(er)
// command succeeded, and data might have some info
})
npm.on("log", function (message) { .... })
npm.registry.log.on("log", function (message) { .... })
})
</code></pre><p>The <code>load</code> function takes an object hash of the command-line configs.
The various <code>npm.commands.<cmd></code> functions take an <strong>array</strong> of
@ -141,7 +141,7 @@ specific purpose, or lack of malice in any given npm package.</p>
<p>If you have a complaint about a package in the public npm registry,
and cannot <ahref="https://www.npmjs.org/doc/misc/npm-disputes.html">resolve it with the package
owner</a>, please email
<ahref="mailto:support@npmjs.com">support@npmjs.com</a> and explain the situation.</p>
<ahref="mailto:support@npmjs.com">support@npmjs.com</a> and explain the situation.</p>
<p>Any data published to The npm Registry (including user account
information) may be removed or modified at the sole discretion of the
npm server administrators.</p>
@ -161,7 +161,7 @@ ban your account in extreme cases. So don't do that.</p>
client, see <code><ahref="../cli/npm.html">npm(1)</a></code>.</p>
<p>Prior to using npm's commands, <code>npm.load()</code> must be called.
If you provide <code>configObject</code> as an object hash of top-level
configs, they override the values stored in the various config
locations. In the npm command line client, this set of configs
is parsed from the command line options. Additional configuration
params are loaded from two configuration files. See <code><ahref="../cli/npm-config.html">npm-config(1)</a></code>,
<code><ahref="../misc/npm-config.html">npm-config(7)</a></code>, and <code><ahref="../files/npmrc.html">npmrc(5)</a></code> for more information.</p>
client, see <code><ahref="../cli/npm.html"><ahref="../cli/npm.html">npm(1)</a></a></code>.</p>
<p>Prior to using npm's commands, <code>npm.load()</code> must be called. If you provide
<code>configObject</code> as an object map of top-level configs, they override the values
stored in the various config locations. In the npm command line client, this
set of configs is parsed from the command line options. Additional
configuration params are loaded from two configuration files. See
<code><ahref="../cli/npm-config.html"><ahref="../cli/npm-config.html">npm-config(1)</a></a></code>, <code><ahref="../misc/npm-config.html"><ahref="../misc/npm-config.html">npm-config(7)</a></a></code>, and <code><ahref="../files/npmrc.html"><ahref="../files/npmrc.html">npmrc(5)</a></a></code> for more information.</p>
<p>After that, each of the functions are accessible in the
commands object: <code>npm.commands.<cmd></code>. See <code><ahref="../misc/npm-index.html">npm-index(7)</a></code> for a list of
commands object: <code>npm.commands.<cmd></code>. See <code><ahref="../misc/npm-index.html"><ahref="../misc/npm-index.html">npm-index(7)</a></a></code> for a list of
all possible commands.</p>
<p>All commands on the command object take an <strong>array</strong> of positional argument
<strong>strings</strong>. The last argument to any function is a callback. Some
@ -80,9 +79,9 @@ command.</p>
</li>
</ul>
<h2id="magic">MAGIC</h2>
<p>For each of the methods in the <code>npm.commands</code>hash, a method is added to
the npm object, which takes a set of positional string arguments rather
than an array and a callback.</p>
<p>For each of the methods in the <code>npm.commands</code>object, a method is added to the
npm object, which takes a set of positional string arguments rather than an
array and a callback.</p>
<p>If the last argument is a callback, then it will use the supplied
callback. However, if no callback is provided, then it will print out
the error or results.</p>
@ -110,5 +109,5 @@ method names. Use the <code>npm.deref</code> method to find the real name.</p>
<p>The base URL of the npm package registry. If <code>scope</code> is also specified,
this registry will only be used for packages with that scope. See <code><ahref="../misc/npm-scope.html">npm-scope(7)</a></code>.</p>
this registry will only be used for packages with that scope. See <code><ahref="../misc/npm-scope.html"><ahref="../misc/npm-scope.html">npm-scope(7)</a></a></code>.</p>
<h3id="scope">scope</h3>
<p>Default: none</p>
<p>If specified, the user and login credentials given will be associated
with the specified scope. See <code><ahref="../misc/npm-scope.html">npm-scope(7)</a></code>. You can use both at the same time,
with the specified scope. See <code><ahref="../misc/npm-scope.html"><ahref="../misc/npm-scope.html">npm-scope(7)</a></a></code>. You can use both at the same time,
</code></pre><p>This will ensure that all requests to that registry (including for tarballs)
include an authorization header. See <code>always-auth</code> in <code><ahref="../misc/npm-config.html"><ahref="../misc/npm-config.html">npm-config(7)</a></a></code> for more
details on always-auth. Registry-specific configuaration of <code>always-auth</code> takes
@ -22,8 +22,8 @@ npm set <key> <value> [--global]
</code></pre><h2id="description">DESCRIPTION</h2>
<p>npm gets its config settings from the command line, environment
variables, <code>npmrc</code> files, and in some cases, the <code>package.json</code> file.</p>
<p>See <ahref="../files/npmrc.html">npmrc(5)</a> for more information about the npmrc files.</p>
<p>See <code><ahref="../misc/npm-config.html">npm-config(7)</a></code> for a more thorough discussion of the mechanisms
<p>See <ahref="../files/npmrc.html"><ahref="../files/npmrc.html">npmrc(5)</a></a> for more information about the npmrc files.</p>
<p>See <code><ahref="../misc/npm-config.html"><ahref="../misc/npm-config.html">npm-config(7)</a></a></code> for a more thorough discussion of the mechanisms
involved.</p>
<p>The <code>npm config</code> command can be used to update and edit the contents
of the user and global npmrc files.</p>
@ -48,11 +48,11 @@ of the user and global npmrc files.</p>
@ -23,7 +23,7 @@ be more effectively shared by multiple dependent packages.</p>
| `-- c@1.0.3
`-- d <-- depends on c@~1.0.9
`-- c@1.0.10
</code></pre><p>In this case, <code><ahref="../cli/npm-dedupe.html">npm-dedupe(1)</a></code> will transform the tree to:</p>
</code></pre><p>In this case, <code><ahref="../cli/npm-dedupe.html"><ahref="../cli/npm-dedupe.html">npm-dedupe(1)</a></a></code> will transform the tree to:</p>
<pre><code>a
+-- b
+-- d
@ -47,9 +47,9 @@ tag with the given name exists, the tagged version is preferred over newer
<p>Opens the package folder in the default editor (or whatever you've
configured as the npm <code>editor</code> config -- see <code><ahref="../misc/npm-config.html">npm-config(7)</a></code>.)</p>
configured as the npm <code>editor</code> config -- see <code><ahref="../misc/npm-config.html"><ahref="../misc/npm-config.html">npm-config(7)</a></a></code>.)</p>
<p>After it has been edited, the package is rebuilt so as to pick up any
changes in compiled packages.</p>
<p>For instance, you can do <code>npm install connect</code> to install connect
@ -30,12 +30,12 @@ or <code>"notepad"</code> on Windows.</li>
<p>The command to run for <code>npm edit</code> or <code>npm config edit</code>.</p>
@ -23,13 +23,13 @@ npm i (with any of the previous argument usage)
</code></pre><h2id="description">DESCRIPTION</h2>
<p>This command installs a package, and any packages that it depends on. If the
package has a shrinkwrap file, the installation of dependencies will be driven
by that. See <ahref="../cli/npm-shrinkwrap.html">npm-shrinkwrap(1)</a>.</p>
by that. See <ahref="../cli/npm-shrinkwrap.html"><ahref="../cli/npm-shrinkwrap.html">npm-shrinkwrap(1)</a></a>.</p>
<p>A <code>package</code> is:</p>
<ul>
<li>a) a folder containing a program described by a package.json file</li>
<li>b) a gzipped tarball containing (a)</li>
<li>c) a url that resolves to (b)</li>
<li>d) a <code><name>@<version></code> that is published on the registry (see <code><ahref="../misc/npm-registry.html">npm-registry(7)</a></code>) with (c)</li>
<li>d) a <code><name>@<version></code> that is published on the registry (see <code><ahref="../misc/npm-registry.html"><ahref="../misc/npm-registry.html">npm-registry(7)</a></a></code>) with (c)</li>
<li>e) a <code><name>@<tag></code> that points to (d)</li>
<li>f) a <code><name></code> that has a "latest" tag satisfying (e)</li>
<li>g) a <code><git remote url></code> that resolves to (b)</li>
@ -66,7 +66,7 @@ after packing it up into a tarball (b).</p>
<p> In most cases, this will install the latest version
of the module published on npm.</p>
<p> Example:</p>
@ -87,7 +87,7 @@ exact version rather than using npm's default semver range
operator.</p>
<p><code><scope></code> is optional. The package will be downloaded from the registry
associated with the specified scope. If no registry is associated with
the given scope the default registry is assumed. See <code><ahref="../misc/npm-scope.html">npm-scope(7)</a></code>.</p>
the given scope the default registry is assumed. See <code><ahref="../misc/npm-scope.html"><ahref="../misc/npm-scope.html">npm-scope(7)</a></a></code>.</p>
<p>Note: if you do not include the @-symbol on your scope name, npm will
interpret this as a GitHub repository instead, see below. Scopes names
must also be followed by a slash.</p>
@ -123,7 +123,7 @@ fetch the package by name if it is not valid.
<p> Install a version of the package matching the specified version range. This
will follow the same rules for resolving dependencies described in <code><ahref="../files/package.json.html">package.json(5)</a></code>.</p>
will follow the same rules for resolving dependencies described in <code><ahref="../files/package.json.html"><ahref="../files/package.json.html">package.json(5)</a></a></code>.</p>
<p> Note that most version ranges must be put in quotes so that your shell will
treat it as a single argument.</p>
<p> Example:</p>
@ -161,7 +161,7 @@ versions.</p>
local copy exists on disk.</p>
<pre><code>npm install sax --force
</code></pre><p>The <code>--global</code> argument will cause npm to install the package globally
rather than locally. See <code><ahref="../files/npm-folders.html">npm-folders(5)</a></code>.</p>
rather than locally. See <code><ahref="../files/npm-folders.html"><ahref="../files/npm-folders.html">npm-folders(5)</a></a></code>.</p>
<p>The <code>--link</code> argument will cause npm to link global installs into the
local space in some cases.</p>
<p>The <code>--no-bin-links</code> argument will prevent npm from creating symlinks for
@ -172,7 +172,7 @@ being installed.</p>
shrinkwrap file and use the package.json instead.</p>
<p>The <code>--nodedir=/path/to/node/source</code> argument will allow npm to find the
node source code so that npm can compile native modules.</p>
<p>See <code><ahref="../misc/npm-config.html">npm-config(7)</a></code>. Many of the configuration params have some
<p>See <code><ahref="../misc/npm-config.html"><ahref="../misc/npm-config.html">npm-config(7)</a></a></code>. Many of the configuration params have some
effect on installation, since that's most of what npm does.</p>
<h2id="algorithm">ALGORITHM</h2>
<p>To install a package, npm uses the following algorithm:</p>
@ -193,7 +193,7 @@ this algorithm produces:</p>
`-- D
</code></pre><p>That is, the dependency from B to C is satisfied by the fact that A
already caused C to be installed at a higher level.</p>
<p>See <ahref="../files/npm-folders.html">npm-folders(5)</a> for a more detailed description of the specific
<p>See <ahref="../files/npm-folders.html"><ahref="../files/npm-folders.html">npm-folders(5)</a></a> for a more detailed description of the specific
folder structures that npm creates.</p>
<h3id="limitations-of-npm-s-install-algorithm">Limitations of npm's Install Algorithm</h3>
<p>There are some very rare and pathological edge-cases where a cycle can
@ -213,19 +213,19 @@ to symlink the existing version into the new location. If this ever
affects a real use-case, it will be investigated.</p>
@ -18,12 +18,12 @@ npm ln (with any of the previous argument usage)
<p>Package linking is a two-step process.</p>
<p>First, <code>npm link</code> in a package folder will create a globally-installed
symbolic link from <code>prefix/package-name</code> to the current folder (see
<code><ahref="../misc/npm-config.html">npm-config(7)</a></code> for the value of <code>prefix</code>).</p>
<code><ahref="../misc/npm-config.html"><ahref="../misc/npm-config.html">npm-config(7)</a></a></code> for the value of <code>prefix</code>).</p>
<p>Next, in some other location, <code>npm link package-name</code> will create a
symlink from the local <code>node_modules</code> folder to the global symlink.</p>
<p>Note that <code>package-name</code> is taken from <code>package.json</code>,
not from directory name.</p>
<p>The package name can be optionally prefixed with a scope. See <code><ahref="../misc/npm-scope.html">npm-scope(7)</a></code>.
<p>The package name can be optionally prefixed with a scope. See <code><ahref="../misc/npm-scope.html"><ahref="../misc/npm-scope.html">npm-scope(7)</a></a></code>.
The scope must by preceded by an @-symbol and followed by a slash.</p>
<p>When creating tarballs for <code>npm publish</code>, the linked packages are
"snapshotted" to their current state by resolving the symbolic links.</p>
@ -45,19 +45,19 @@ npm link ../node-redis # link the dir of your dependency
npm link redis
</code></pre><p>That is, it first creates a global link, and then links the global
installation target into your project's <code>node_modules</code> folder.</p>
<p>If your linked package is scoped (see <code><ahref="../misc/npm-scope.html">npm-scope(7)</a></code>) your link command must
<p>If your linked package is scoped (see <code><ahref="../misc/npm-scope.html"><ahref="../misc/npm-scope.html">npm-scope(7)</a></a></code>) your link command must
<p>Publishes a package to the registry so that it can be installed by name.</p>
<p>Publishes a package to the registry so that it can be installed by name. See
<code><ahref="../misc/npm-developers.html"><ahref="../misc/npm-developers.html">npm-developers(7)</a></a></code> for details on what's included in the published package, as
well as details on how the package is built.</p>
<p>By default npm will publish to the public registry. This can be overridden by
specifying a different default registry or using a <code><ahref="../misc/npm-scope.html">npm-scope(7)</a></code> in the name
(see <code><ahref="../files/package.json.html">package.json(5)</a></code>).</p>
specifying a different default registry or using a <code><ahref="../misc/npm-scope.html"><ahref="../misc/npm-scope.html">npm-scope(7)</a></a></code> in the name
(see <code><ahref="../files/package.json.html"><ahref="../files/package.json.html">package.json(5)</a></a></code>).</p>
<ul>
<li><p><code><folder></code>:
A folder containing a package.json file</p>
@ -36,14 +38,14 @@ and <code>npm install</code> installs the <code>latest</code> tag.</p>
the specified registry.</p>
<p>Once a package is published with a given name and version, that
specific name and version combination can never be used again, even if
it is removed with <ahref="../cli/npm-unpublish.html">npm-unpublish(1)</a>.</p>
it is removed with <ahref="../cli/npm-unpublish.html"><ahref="../cli/npm-unpublish.html">npm-unpublish(1)</a></a>.</p>