@@ -18,9 +18,9 @@ <h2 id="description">DESCRIPTION</h2>
<pre><code>@somescope/somepackagename
</code></pre><p>Scopes are a way of grouping related packages together, and also affect a few
things about the way npm treats the package.</p>
<p><strong>As of 2014-09-03, scoped packages are not supported by the public npm registry</strong>.
However, the npm client is backwards-compatible with un-scoped registries, so
it can be used to work with scoped and un-scoped registries at the same time.</p>
<p>Scoped packages are supported by the public npm registry. The npm
client is backwards-compatible with un-scoped registries, so it can be
used to work with scoped and un-scoped registries at the same time.</p>
<h2 id="installing-scoped-packages">Installing scoped packages</h2>
<p>Scoped packages are installed to a sub-folder of the regular installation
folder, e.g. if your other packages are installed in <code>node_modules/packagename</code>,
@@ -43,10 +43,22 @@ <h2 id="requiring-scoped-packages">Requiring scoped packages</h2>
</code></pre><p>There is nothing special about the way Node treats scope folders, this is
just specifying to require the module <code>mypackage</code> in the folder called <code>@myorg</code>.</p>
<h2 id="publishing-scoped-packages">Publishing scoped packages</h2>
<p>Scoped packages can be published to any registry that supports them.
<em>As of 2014-09-03, the public npm registry does not support scoped packages</em>,
so attempting to publish a scoped package to the registry will fail unless
you have associated that scope with a different registry, see below.</p>
<p>Scoped packages can be published to any registry that supports them, including
the public npm registry.</p>
<p>(As of 2015-04-19, the public npm registry <strong>does</strong> support scoped packages)</p>
<p>If you wish, you may associate a scope with a registry; see below.</p>
<h3 id="publishing-public-scoped-packages-to-the-public-npm-registry">Publishing public scoped packages to the public npm registry</h3>
<p>To publish a public scoped package, you must specify <code>--access public</code> with
the initial publication. This will publish the package and set access
to <code>public</code> as if you had run <code>npm access public</code> after publishing.</p>
<h3 id="publishing-private-scoped-packages-to-the-npm-registry">Publishing private scoped packages to the npm registry</h3>
<p>To publish a private scoped package to the npm registry, you must have
an <a href="https://www.npmjs.com/private-modules">npm Private Modules</a>
account.</p>
<p>You can then publish the module with <code>npm publish</code> or <code>npm publish
--access restricted</code>, and it will be present in the npm registry, with
restricted access. You can then change the access permissions, if
desired, with <code>npm access</code> or on the npmjs.com website.</p>
<h2 id="associating-a-scope-with-a-registry">Associating a scope with a registry</h2>
<p>Scopes can be associated with a separate registry. This allows you to
seamlessly use a mix of packages from the public npm registry and one or more
@@ -65,6 +77,7 @@ <h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-install.html"><a href="../cli/npm-install.html">npm-install(1)</a></a></li>
<li><a href="../cli/npm-publish.html"><a href="../cli/npm-publish.html">npm-publish(1)</a></a></li>
<li><a href="../cli/npm-access.html"><a href="../cli/npm-access.html">npm-access(1)</a></a></li>
</ul>

</div>
@@ -78,5 +91,5 @@ <h2 id="see-also">SEE ALSO</h2>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-scope &mdash; npm@2.7.4</p>
<p id="footer">npm-scope &mdash; npm@2.9.1</p>

@@ -203,5 +203,5 @@ <h2 id="see-also">SEE ALSO</h2>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">npm-scripts &mdash; npm@2.7.4</p>
<p id="footer">npm-scripts &mdash; npm@2.9.1</p>

@@ -57,5 +57,5 @@ <h2 id="see-also">SEE ALSO</h2>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">removing-npm &mdash; npm@2.7.4</p>
<p id="footer">removing-npm &mdash; npm@2.9.1</p>

@@ -282,5 +282,5 @@ <h3 id="ranges">Ranges</h3>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
</table>
<p id="footer">semver &mdash; npm@2.7.4</p>
<p id="footer">semver &mdash; npm@2.9.1</p>

@@ -21,7 +21,7 @@ <h2 id="fancy-install-unix-">Fancy Install (Unix)</h2>
<p>There&#39;s a pretty robust install script at
<a href="https://www.npmjs.com/install.sh">https://www.npmjs.com/install.sh</a>. You can download that and run it.</p>
<p>Here&#39;s an example using curl:</p>
<pre><code>curl -L https://npmjs.com/install.sh | sh
<pre><code>curl -L https://www.npmjs.com/install.sh | sh
</code></pre><h3 id="slightly-fancier">Slightly Fancier</h3>
<p>You can set any npm configuration params with that script:</p>
<pre><code>npm_config_prefix=/some/path sh install.sh
@@ -35,10 +35,10 @@ <h2 id="fancy-install-unix-">Fancy Install (Unix)</h2>
run npm commands by doing <code>node cli.js &lt;cmd&gt; &lt;args&gt;</code>. (This is helpful
for testing, or running stuff without actually installing npm itself.)</p>
<h2 id="windows-install-or-upgrade">Windows Install or Upgrade</h2>
<p>You can download a zip file from <a href="https://github.com/npm/npm/releases">https://github.com/npm/npm/releases</a>, and unpack it
in the same folder where node.exe lives.</p>
<p>The latest version in a zip file is 1.4.12. To upgrade to npm 2, follow the
Windows upgrade instructions in the npm Troubleshooting Guide:</p>
<p>You can download a zip file from <a href="https://github.com/npm/npm/releases">https://github.com/npm/npm/releases</a>, and
unpack it in the <code>node_modules\npm\</code> folder inside node&#39;s installation folder.</p>
<p>To upgrade to npm 2, follow the Windows upgrade instructions in
the npm Troubleshooting Guide:</p>
<p><a href="https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows">https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows</a></p>
<p>If that&#39;s not fancy enough for you, then you can fetch the code with
git, and mess with it directly.</p>
@@ -115,7 +115,7 @@ <h2 id="legal-stuff">Legal Stuff</h2>
<p>If you have a complaint about a package in the public npm registry,
and cannot <a href="https://docs.npmjs.com/misc/disputes">resolve it with the package
owner</a>, please email
<a href="&#x6d;&#x61;&#x69;&#x6c;&#x74;&#x6f;&#x3a;&#115;&#x75;&#x70;&#112;&#111;&#114;&#116;&#x40;&#x6e;&#112;&#x6d;&#106;&#x73;&#x2e;&#x63;&#x6f;&#x6d;">&#115;&#x75;&#x70;&#112;&#111;&#114;&#116;&#x40;&#x6e;&#112;&#x6d;&#106;&#x73;&#x2e;&#x63;&#x6f;&#x6d;</a> and explain the situation.</p>
<a href="&#109;&#x61;&#x69;&#x6c;&#x74;&#x6f;&#x3a;&#115;&#117;&#112;&#x70;&#111;&#114;&#116;&#x40;&#110;&#x70;&#109;&#x6a;&#115;&#46;&#99;&#x6f;&#x6d;">&#115;&#117;&#112;&#x70;&#111;&#114;&#116;&#x40;&#110;&#x70;&#109;&#x6a;&#115;&#46;&#99;&#x6f;&#x6d;</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>
@@ -12,7 +12,7 @@ <h2 id="synopsis">SYNOPSIS</h2>
npm.commands.install([&quot;package&quot;], cb)
})
</code></pre><h2 id="version">VERSION</h2>
<p>2.7.4</p>
<p>2.9.1</p>
<h2 id="description">DESCRIPTION</h2>
<p>This is the API documentation for npm.
To find documentation of the command line
@@ -7,8 +7,10 @@ <h2 id="synopsis">SYNOPSIS</h2>
</ul>
<h2 id="description">DESCRIPTION</h2>
<p>This is the plumbing command called by <code>npm link</code> and <code>npm install</code>.</p>
<p>It should generally not be called directly.</p>
<h2 id="see-also">SEE ALSO</h2>
<p>It should generally be called during installation, but if you need to run it
directly, run:</p>
<pre><code>npm run-script build
</code></pre><h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-install.html">npm-install(1)</a></li>
<li><a href="../cli/npm-link.html">npm-link(1)</a></li>
@@ -24,7 +24,8 @@ <h2 id="synopsis">SYNOPSIS</h2>
</code></pre><p>When installing dependencies, a preferred tagged version may be specified:</p>
<pre><code>npm install --tag &lt;tag&gt;
</code></pre><p>This also applies to <code>npm dedupe</code>.</p>
<p>Publishing a package always sets the &quot;latest&quot; tag to the published version.</p>
<p>Publishing a package sets the &quot;latest&quot; tag to the published version unless the
<code>--tag</code> option is used. For example, <code>npm publish --tag=beta</code>.</p>
<h2 id="purpose">PURPOSE</h2>
<p>Tags can be used to provide an alias instead of version numbers. For
example, <code>npm</code> currently uses the tag &quot;next&quot; to identify the upcoming
@@ -125,13 +125,37 @@ <h2 id="synopsis">SYNOPSIS</h2>
attempting to clone it using <code>git</code>.</p>
<p> Example:</p>
<pre><code> npm install mygithubuser/myproject
</code></pre><p> To reference a package in a git repo that is not on GitHub, see git
remote urls below.</p>
</code></pre><p> To reference a package in a generic git repo (not on GitHub), see git remote
urls below.</p>
</li>
<li><p><code>npm install github:&lt;githubname&gt;/&lt;githubrepo&gt;</code>:</p>
<p> The same as the above, but explicitly marked as a GitHub dependency.</p>
<p> Example:</p>
<pre><code> npm install github:npm/npm
</code></pre></li>
<li><p><code>npm install gist:[&lt;githubname&gt;/]&lt;gistID&gt;</code>:</p>
<p> Install the package at <code>https://gist.github.com/gistID</code> by attempting to
clone it using <code>git</code>. The GitHub username associated with the gist is
optional and will not be saved in <code>package.json</code> if <code>--save</code> is used.</p>
<p> Example:</p>
<pre><code> npm install gist:101a11beef
</code></pre></li>
<li><p><code>npm install bitbucket:&lt;bitbucketname&gt;/&lt;bitbucketrepo&gt;</code>:</p>
<p> Install the package at <code>https://bitbucket.org/bitbucketname/bitbucketrepo</code>
by attempting to clone it using <code>git</code>.</p>
<p> Example:</p>
<pre><code> npm install bitbucket:mybitbucketuser/myproject
</code></pre></li>
<li><p><code>npm install gitlab:&lt;gitlabname&gt;/&lt;gitlabrepo&gt;</code>:</p>
<p> Install the package at <code>https://gitlab.com/gitlabname/gitlabrepo</code>
by attempting to clone it using <code>git</code>.</p>
<p> Example:</p>
<pre><code> npm install gitlab:mygitlabuser/myproject
</code></pre></li>
<li><p><code>npm install &lt;git remote url&gt;</code>:</p>
<p> Install a package by cloning a git remote url. The format of the git
url is:</p>
<pre><code> &lt;protocol&gt;://[&lt;user&gt;@]&lt;hostname&gt;&lt;separator&gt;&lt;path&gt;[#&lt;commit-ish&gt;]
<pre><code> &lt;protocol&gt;://[&lt;user&gt;[:&lt;password&gt;]@]&lt;hostname&gt;&lt;separator&gt;&lt;path&gt;[#&lt;commit-ish&gt;]
</code></pre><p> <code>&lt;protocol&gt;</code> is one of <code>git</code>, <code>git+ssh</code>, <code>git+http</code>, or
<code>git+https</code>. If no <code>&lt;commit-ish&gt;</code> is specified, then <code>master</code> is
used.</p>
@@ -11,7 +11,7 @@ <h2 id="synopsis">SYNOPSIS</h2>
limit the results to only the paths to the packages named. Note that
nested packages will <em>also</em> show the paths to the specified packages.
For example, running <code>npm ls promzard</code> in npm&#39;s source tree will show:</p>
<pre><code>npm@2.7.4 /path/to/npm
<pre><code>npm@2.9.1 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre><p>It will print out extraneous, missing, and invalid packages.</p>
@@ -4,9 +4,9 @@ <h2 id="synopsis">SYNOPSIS</h2>
</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This command locks down the versions of a package&#39;s dependencies so
that you can control exactly which versions of each dependency will be
used when your package is installed. The &quot;package.json&quot; file is still
required if you want to use &quot;npm install&quot;.</p>
<p>By default, &quot;npm install&quot; recursively installs the target&#39;s
used when your package is installed. The <code>package.json</code> file is still
required if you want to use <code>npm install</code>.</p>
<p>By default, <code>npm install</code> recursively installs the target&#39;s
dependencies (as specified in package.json), choosing the latest
available version that satisfies the dependency&#39;s semver pattern. In
some situations, particularly when shipping software where each change
@@ -40,11 +40,11 @@ <h2 id="synopsis">SYNOPSIS</h2>
&quot;version&quot;: &quot;0.0.1&quot;
}
</code></pre><p>If these are the only versions of A, B, and C available in the
registry, then a normal &quot;npm install A&quot; will install:</p>
registry, then a normal <code>npm install A</code> will install:</p>
<pre><code>A@0.1.0
`-- B@0.0.1
`-- C@0.0.1
</code></pre><p>However, if B@0.0.2 is published, then a fresh &quot;npm install A&quot; will
</code></pre><p>However, if B@0.0.2 is published, then a fresh <code>npm install A</code> will
install:</p>
<pre><code>A@0.1.0
`-- B@0.0.2
@@ -74,7 +74,7 @@ <h2 id="synopsis">SYNOPSIS</h2>
}
}
</code></pre><p>The shrinkwrap command has locked down the dependencies based on
what&#39;s currently installed in node_modules. When &quot;npm install&quot;
what&#39;s currently installed in node_modules. When <code>npm install</code>
installs a package with a npm-shrinkwrap.json file in the package
root, the shrinkwrap file (rather than package.json files) completely
drives the installation of that package and all of its dependencies
@@ -84,41 +84,41 @@ <h2 id="synopsis">SYNOPSIS</h2>
files.</p>
<h3 id="using-shrinkwrapped-packages">Using shrinkwrapped packages</h3>
<p>Using a shrinkwrapped package is no different than using any other
package: you can &quot;npm install&quot; it by hand, or add a dependency to your
package.json file and &quot;npm install&quot; it.</p>
package: you can <code>npm install</code> it by hand, or add a dependency to your
package.json file and <code>npm install</code> it.</p>
<h3 id="building-shrinkwrapped-packages">Building shrinkwrapped packages</h3>
<p>To shrinkwrap an existing package:</p>
<ol>
<li>Run &quot;npm install&quot; in the package root to install the current
<li>Run <code>npm install</code> in the package root to install the current
versions of all dependencies.</li>
<li>Validate that the package works as expected with these versions.</li>
<li>Run &quot;npm shrinkwrap&quot;, add npm-shrinkwrap.json to git, and publish
<li>Run <code>npm shrinkwrap</code>, add npm-shrinkwrap.json to git, and publish
your package.</li>
</ol>
<p>To add or update a dependency in a shrinkwrapped package:</p>
<ol>
<li>Run &quot;npm install&quot; in the package root to install the current
<li>Run <code>npm install</code> in the package root to install the current
versions of all dependencies.</li>
<li>Add or update dependencies. &quot;npm install&quot; each new or updated
<li>Add or update dependencies. <code>npm install</code> each new or updated
package individually and then update package.json. Note that they
must be explicitly named in order to be installed: running <code>npm
install</code> with no arguments will merely reproduce the existing
shrinkwrap.</li>
<li>Validate that the package works as expected with the new
dependencies.</li>
<li>Run &quot;npm shrinkwrap&quot;, commit the new npm-shrinkwrap.json, and
<li>Run <code>npm shrinkwrap</code>, commit the new npm-shrinkwrap.json, and
publish your package.</li>
</ol>
<p>You can use <a href="../cli/npm-outdated.html">npm-outdated(1)</a> to view dependencies with newer versions
available.</p>
<h3 id="other-notes">Other Notes</h3>
<p>A shrinkwrap file must be consistent with the package&#39;s package.json
file. &quot;npm shrinkwrap&quot; will fail if required dependencies are not
file. <code>npm shrinkwrap</code> will fail if required dependencies are not
already installed, since that would result in a shrinkwrap that
wouldn&#39;t actually work. Similarly, the command will fail if there are
extraneous packages (not referenced by package.json), since that would
indicate that package.json is not correct.</p>
<p>Since &quot;npm shrinkwrap&quot; is intended to lock down your dependencies for
<p>Since <code>npm shrinkwrap</code> is intended to lock down your dependencies for
production use, <code>devDependencies</code> will not be included unless you
explicitly set the <code>--dev</code> flag when you run <code>npm shrinkwrap</code>. If
installed <code>devDependencies</code> are excluded, then npm will print a
@@ -2,7 +2,7 @@ <h1><a href="../cli/npm.html">npm</a></h1> <p>javascript package manager</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm &lt;command&gt; [args]
</code></pre><h2 id="version">VERSION</h2>
<p>2.7.4</p>
<p>2.9.1</p>
<h2 id="description">DESCRIPTION</h2>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
@@ -99,15 +99,15 @@ <h2 id="contributions">CONTRIBUTIONS</h2>
the issues list or ask on the mailing list.</p>
<ul>
<li><a href="http://github.com/npm/npm/issues">http://github.com/npm/npm/issues</a></li>
<li><a href="&#x6d;&#97;&#105;&#x6c;&#x74;&#x6f;&#x3a;&#x6e;&#x70;&#109;&#45;&#64;&#x67;&#111;&#x6f;&#x67;&#108;&#101;&#x67;&#114;&#x6f;&#x75;&#112;&#115;&#x2e;&#x63;&#x6f;&#x6d;">&#x6e;&#x70;&#109;&#45;&#64;&#x67;&#111;&#x6f;&#x67;&#108;&#101;&#x67;&#114;&#x6f;&#x75;&#112;&#115;&#x2e;&#x63;&#x6f;&#x6d;</a></li>
<li><a href="&#109;&#x61;&#105;&#108;&#116;&#111;&#58;&#x6e;&#112;&#x6d;&#45;&#64;&#103;&#x6f;&#x6f;&#103;&#x6c;&#101;&#x67;&#x72;&#x6f;&#117;&#x70;&#115;&#x2e;&#x63;&#111;&#x6d;">&#x6e;&#112;&#x6d;&#45;&#64;&#103;&#x6f;&#x6f;&#103;&#x6c;&#101;&#x67;&#x72;&#x6f;&#117;&#x70;&#115;&#x2e;&#x63;&#111;&#x6d;</a></li>
</ul>
<h2 id="bugs">BUGS</h2>
<p>When you find issues, please report them:</p>
<ul>
<li>web:
<a href="http://github.com/npm/npm/issues">http://github.com/npm/npm/issues</a></li>
<li>email:
<a href="&#109;&#97;&#105;&#108;&#x74;&#111;&#58;&#110;&#112;&#109;&#45;&#64;&#x67;&#x6f;&#x6f;&#x67;&#x6c;&#x65;&#103;&#114;&#x6f;&#117;&#x70;&#115;&#46;&#99;&#111;&#109;">&#110;&#112;&#109;&#45;&#64;&#x67;&#x6f;&#x6f;&#x67;&#x6c;&#x65;&#103;&#114;&#x6f;&#117;&#x70;&#115;&#46;&#99;&#111;&#109;</a></li>
<a href="&#109;&#97;&#105;&#x6c;&#116;&#x6f;&#58;&#x6e;&#112;&#x6d;&#x2d;&#x40;&#103;&#x6f;&#x6f;&#103;&#108;&#101;&#x67;&#x72;&#x6f;&#x75;&#x70;&#115;&#46;&#x63;&#x6f;&#109;">&#x6e;&#112;&#x6d;&#x2d;&#x40;&#103;&#x6f;&#x6f;&#103;&#108;&#101;&#x67;&#x72;&#x6f;&#x75;&#x70;&#115;&#46;&#x63;&#x6f;&#109;</a></li>
</ul>
<p>Be sure to include <em>all</em> of the output from the npm command that didn&#39;t work
as expected. The <code>npm-debug.log</code> file is also helpful to provide.</p>
@@ -117,7 +117,7 @@ <h2 id="author">AUTHOR</h2>
<p><a href="http://blog.izs.me/">Isaac Z. Schlueter</a> ::
<a href="https://github.com/isaacs/">isaacs</a> ::
<a href="http://twitter.com/izs">@izs</a> ::
<a href="&#x6d;&#x61;&#105;&#108;&#x74;&#111;&#x3a;&#x69;&#x40;&#105;&#122;&#115;&#x2e;&#109;&#101;">&#x69;&#x40;&#105;&#122;&#115;&#x2e;&#109;&#101;</a></p>
<a href="&#109;&#x61;&#105;&#x6c;&#x74;&#x6f;&#58;&#x69;&#64;&#105;&#x7a;&#x73;&#x2e;&#x6d;&#101;">&#x69;&#64;&#105;&#x7a;&#x73;&#x2e;&#x6d;&#101;</a></p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-help.html">npm-help(1)</a></li>
@@ -10,14 +10,22 @@ <h2 id="name">name</h2>
them. The name and version together form an identifier that is assumed
to be completely unique. Changes to the package should come along with
changes to the version.</p>
<p>The name is what your thing is called. Some tips:</p>
<p>The name is what your thing is called.</p>
<p>Some rules:</p>
<ul>
<li>The name must be shorter than 214 characters. This includes the scope for
scoped packages.</li>
<li>The name can&#39;t start with a dot or an underscore.</li>
<li>New packages must not have uppercase letters in the name.</li>
<li>The name ends up being part of a URL, an argument on the command line, and a
folder name. Therefore, the name can&#39;t contain any non-URL-safe characters.</li>
</ul>
<p>Some tips:</p>
<ul>
<li>Don&#39;t use the same name as a core Node module.</li>
<li>Don&#39;t put &quot;js&quot; or &quot;node&quot; in the name. It&#39;s assumed that it&#39;s js, since you&#39;re
writing a package.json file, and you can specify the engine using the &quot;engines&quot;
field. (See below.)</li>
<li>The name ends up being part of a URL, an argument on the command line, and a
folder name. Any name with non-url-safe characters will be rejected.
Also, it can&#39;t start with a dot or an underscore.</li>
<li>The name will probably be passed as an argument to require(), so it should
be something short, but also reasonably descriptive.</li>
<li>You may want to check the npm registry to see if there&#39;s something by that name
@@ -78,7 +86,7 @@ <h2 id="people-fields-author-contributors">people fields: author, contributors</
, &quot;url&quot; : &quot;http://barnyrubble.tumblr.com/&quot;
}
</code></pre><p>Or you can shorten that all into a single string, and npm will parse it for you:</p>
<pre><code>&quot;Barney Rubble &lt;b@rubble.com&gt; (http://barnyrubble.tumblr.com/)
<pre><code>&quot;Barney Rubble &lt;b@rubble.com&gt; (http://barnyrubble.tumblr.com/)&quot;
</code></pre><p>Both email and url are optional either way.</p>
<p>npm also sets a top-level &quot;maintainers&quot; field with your npm user info.</p>
<h2 id="files">files</h2>
@@ -185,9 +193,15 @@ <h2 id="repository">repository</h2>
</code></pre><p>The URL should be a publicly available (perhaps read-only) url that can be handed
directly to a VCS program without any modification. It should not be a url to an
html project page that you put in your browser. It&#39;s for computers.</p>
<p>For GitHub repositories you can use the same shortcut syntax you use for <code>npm
install</code>:</p>
<p>For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same
shortcut syntax you use for <code>npm install</code>:</p>
<pre><code>&quot;repository&quot;: &quot;npm/npm&quot;

&quot;repository&quot;: &quot;gist:11081aaa281&quot;

&quot;repository&quot;: &quot;bitbucket:example/repo&quot;

&quot;repository&quot;: &quot;gitlab:another/repo&quot;
</code></pre><h2 id="scripts">scripts</h2>
<p>The &quot;scripts&quot; property is a dictionary containing script commands that are run
at various times in the lifecycle of your package. The key is the lifecycle
@@ -10,7 +10,7 @@ <h2 id="files">FILES</h2>
<ul>
<li>per-project config file (/path/to/my/project/.npmrc)</li>
<li>per-user config file (~/.npmrc)</li>
<li>global config file ($PREFIX/npmrc)</li>
<li>global config file ($PREFIX/etc/npmrc)</li>
<li>npm builtin config file (/path/to/npm/npmrc)</li>
</ul>
<p>All npm config files are an ini-formatted list of <code>key = value</code>
@@ -10,14 +10,22 @@ <h2 id="name">name</h2>
them. The name and version together form an identifier that is assumed
to be completely unique. Changes to the package should come along with
changes to the version.</p>
<p>The name is what your thing is called. Some tips:</p>
<p>The name is what your thing is called.</p>
<p>Some rules:</p>
<ul>
<li>The name must be shorter than 214 characters. This includes the scope for
scoped packages.</li>
<li>The name can&#39;t start with a dot or an underscore.</li>
<li>New packages must not have uppercase letters in the name.</li>
<li>The name ends up being part of a URL, an argument on the command line, and a
folder name. Therefore, the name can&#39;t contain any non-URL-safe characters.</li>
</ul>
<p>Some tips:</p>
<ul>
<li>Don&#39;t use the same name as a core Node module.</li>
<li>Don&#39;t put &quot;js&quot; or &quot;node&quot; in the name. It&#39;s assumed that it&#39;s js, since you&#39;re
writing a package.json file, and you can specify the engine using the &quot;engines&quot;
field. (See below.)</li>
<li>The name ends up being part of a URL, an argument on the command line, and a
folder name. Any name with non-url-safe characters will be rejected.
Also, it can&#39;t start with a dot or an underscore.</li>
<li>The name will probably be passed as an argument to require(), so it should
be something short, but also reasonably descriptive.</li>
<li>You may want to check the npm registry to see if there&#39;s something by that name
@@ -78,7 +86,7 @@ <h2 id="people-fields-author-contributors">people fields: author, contributors</
, &quot;url&quot; : &quot;http://barnyrubble.tumblr.com/&quot;
}
</code></pre><p>Or you can shorten that all into a single string, and npm will parse it for you:</p>
<pre><code>&quot;Barney Rubble &lt;b@rubble.com&gt; (http://barnyrubble.tumblr.com/)
<pre><code>&quot;Barney Rubble &lt;b@rubble.com&gt; (http://barnyrubble.tumblr.com/)&quot;
</code></pre><p>Both email and url are optional either way.</p>
<p>npm also sets a top-level &quot;maintainers&quot; field with your npm user info.</p>
<h2 id="files">files</h2>
@@ -185,9 +193,15 @@ <h2 id="repository">repository</h2>
</code></pre><p>The URL should be a publicly available (perhaps read-only) url that can be handed
directly to a VCS program without any modification. It should not be a url to an
html project page that you put in your browser. It&#39;s for computers.</p>
<p>For GitHub repositories you can use the same shortcut syntax you use for <code>npm
install</code>:</p>
<p>For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same
shortcut syntax you use for <code>npm install</code>:</p>
<pre><code>&quot;repository&quot;: &quot;npm/npm&quot;

&quot;repository&quot;: &quot;gist:11081aaa281&quot;

&quot;repository&quot;: &quot;bitbucket:example/repo&quot;

&quot;repository&quot;: &quot;gitlab:another/repo&quot;
</code></pre><h2 id="scripts">scripts</h2>
<p>The &quot;scripts&quot; property is a dictionary containing script commands that are run
at various times in the lifecycle of your package. The key is the lifecycle
@@ -1,6 +1,6 @@
<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>
<p>npm gets its configuration values from the following sources, sorted by 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>&quot;bar&quot;</code>. A <code>--</code> argument tells the cli parser to stop
@@ -678,6 +678,17 @@ <h3 id="tag">tag</h3>
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="tag-version-prefix">tag-version-prefix</h3>
<ul>
<li>Default: <code>&quot;v&quot;</code></li>
<li>Type: String</li>
</ul>
<p>If set, alters the prefix used when tagging a new version when performing a
version increment using <code>npm-version</code>. To remove the prefix altogether, set it
to the empty string: <code>&quot;&quot;</code>.</p>
<p>Because other tools may rely on the convention that npm version tags look like
<code>v1.0.0</code>, <em>only use this property if it is absolutely necessary</em>. In
particular, use care when overriding this setting for public packages.</p>
<h3 id="tmp">tmp</h3>
<ul>
<li>Default: TMPDIR environment variable, or &quot;/tmp&quot;</li>
@@ -2,7 +2,7 @@ <h1><a href="../misc/npm-disputes.html">npm-disputes</a></h1> <p>Handling Module
<h2 id="synopsis">SYNOPSIS</h2>
<ol>
<li>Get the author email with <code>npm owner ls &lt;pkgname&gt;</code></li>
<li>Email the author, CC <a href="&#x6d;&#97;&#105;&#108;&#x74;&#x6f;&#58;&#x73;&#x75;&#x70;&#x70;&#x6f;&#x72;&#x74;&#64;&#110;&#112;&#x6d;&#x6a;&#x73;&#x2e;&#x63;&#111;&#x6d;">&#x73;&#x75;&#x70;&#x70;&#x6f;&#x72;&#x74;&#64;&#110;&#112;&#x6d;&#x6a;&#x73;&#x2e;&#x63;&#111;&#x6d;</a></li>
<li>Email the author, CC <a href="&#x6d;&#x61;&#105;&#x6c;&#116;&#x6f;&#58;&#x73;&#x75;&#112;&#x70;&#111;&#x72;&#x74;&#x40;&#110;&#112;&#x6d;&#x6a;&#115;&#x2e;&#x63;&#x6f;&#109;">&#x73;&#x75;&#112;&#x70;&#111;&#x72;&#x74;&#x40;&#110;&#112;&#x6d;&#x6a;&#115;&#x2e;&#x63;&#x6f;&#109;</a></li>
<li>After a few weeks, if there&#39;s no resolution, we&#39;ll sort it out.</li>
</ol>
<p>Don&#39;t squat on package names. Publish code or move out of the way.</p>
@@ -40,12 +40,12 @@ <h2 id="description">DESCRIPTION</h2>
owner (Bob).</li>
<li>Joe emails Bob, explaining the situation <strong>as respectfully as
possible</strong>, and what he would like to do with the module name. He
adds the npm support staff <a href="&#109;&#x61;&#x69;&#108;&#116;&#x6f;&#x3a;&#115;&#x75;&#112;&#x70;&#x6f;&#114;&#x74;&#64;&#110;&#112;&#x6d;&#x6a;&#115;&#46;&#x63;&#111;&#x6d;">&#115;&#x75;&#112;&#x70;&#x6f;&#114;&#x74;&#64;&#110;&#112;&#x6d;&#x6a;&#115;&#46;&#x63;&#111;&#x6d;</a> to the CC list of
adds the npm support staff <a href="&#109;&#97;&#x69;&#108;&#116;&#x6f;&#x3a;&#115;&#x75;&#x70;&#112;&#111;&#114;&#116;&#x40;&#110;&#x70;&#109;&#106;&#x73;&#x2e;&#x63;&#111;&#x6d;">&#115;&#x75;&#x70;&#112;&#111;&#114;&#116;&#x40;&#110;&#x70;&#109;&#106;&#x73;&#x2e;&#x63;&#111;&#x6d;</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&#39;t come to any sort of resolution, email support
<a href="&#109;&#97;&#105;&#108;&#x74;&#111;&#x3a;&#x73;&#x75;&#112;&#x70;&#111;&#114;&#x74;&#x40;&#x6e;&#112;&#109;&#106;&#x73;&#x2e;&#x63;&#111;&#109;">&#x73;&#x75;&#112;&#x70;&#111;&#114;&#x74;&#x40;&#x6e;&#112;&#109;&#106;&#x73;&#x2e;&#x63;&#111;&#109;</a> and we&#39;ll sort it out. (&quot;Reasonable&quot; is
<a href="&#x6d;&#x61;&#105;&#108;&#x74;&#111;&#x3a;&#115;&#117;&#x70;&#112;&#111;&#x72;&#116;&#x40;&#110;&#x70;&#109;&#x6a;&#x73;&#x2e;&#99;&#111;&#109;">&#115;&#117;&#x70;&#112;&#111;&#x72;&#116;&#x40;&#110;&#x70;&#109;&#x6a;&#x73;&#x2e;&#99;&#111;&#109;</a> and we&#39;ll sort it out. (&quot;Reasonable&quot; is
usually at least 4 weeks, but extra time is allowed around common
holidays.)</li>
</ol>
@@ -225,7 +225,7 @@ <h2 id="i-get-econnrefused-a-lot-what-s-up-">I get ECONNREFUSED a lot. What&#39
<p>To check if the registry is down, open up
<a href="https://registry.npmjs.org/">https://registry.npmjs.org/</a> in a web browser. This will also tell
you if you are just unable to access the internet for some reason.</p>
<p>If the registry IS down, let us know by emailing <a href="&#x6d;&#x61;&#105;&#108;&#116;&#x6f;&#x3a;&#x73;&#x75;&#112;&#x70;&#x6f;&#x72;&#116;&#x40;&#x6e;&#112;&#x6d;&#x6a;&#x73;&#46;&#x63;&#111;&#109;">&#x73;&#x75;&#112;&#x70;&#x6f;&#x72;&#116;&#x40;&#x6e;&#112;&#x6d;&#x6a;&#x73;&#46;&#x63;&#111;&#109;</a>
<p>If the registry IS down, let us know by emailing <a href="&#109;&#97;&#x69;&#x6c;&#x74;&#x6f;&#58;&#115;&#117;&#x70;&#x70;&#111;&#x72;&#x74;&#x40;&#110;&#x70;&#109;&#106;&#115;&#x2e;&#x63;&#x6f;&#109;">&#115;&#117;&#x70;&#x70;&#111;&#x72;&#x74;&#x40;&#110;&#x70;&#109;&#106;&#115;&#x2e;&#x63;&#x6f;&#109;</a>
or posting an issue at <a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a>. If it&#39;s
down for the world (and not just on your local network) then we&#39;re
probably already being pinged about it.</p>
@@ -7,9 +7,9 @@ <h2 id="description">DESCRIPTION</h2>
<pre><code>@somescope/somepackagename
</code></pre><p>Scopes are a way of grouping related packages together, and also affect a few
things about the way npm treats the package.</p>
<p><strong>As of 2014-09-03, scoped packages are not supported by the public npm registry</strong>.
However, the npm client is backwards-compatible with un-scoped registries, so
it can be used to work with scoped and un-scoped registries at the same time.</p>
<p>Scoped packages are supported by the public npm registry. The npm
client is backwards-compatible with un-scoped registries, so it can be
used to work with scoped and un-scoped registries at the same time.</p>
<h2 id="installing-scoped-packages">Installing scoped packages</h2>
<p>Scoped packages are installed to a sub-folder of the regular installation
folder, e.g. if your other packages are installed in <code>node_modules/packagename</code>,
@@ -32,10 +32,22 @@ <h2 id="requiring-scoped-packages">Requiring scoped packages</h2>
</code></pre><p>There is nothing special about the way Node treats scope folders, this is
just specifying to require the module <code>mypackage</code> in the folder called <code>@myorg</code>.</p>
<h2 id="publishing-scoped-packages">Publishing scoped packages</h2>
<p>Scoped packages can be published to any registry that supports them.
<em>As of 2014-09-03, the public npm registry does not support scoped packages</em>,
so attempting to publish a scoped package to the registry will fail unless
you have associated that scope with a different registry, see below.</p>
<p>Scoped packages can be published to any registry that supports them, including
the public npm registry.</p>
<p>(As of 2015-04-19, the public npm registry <strong>does</strong> support scoped packages)</p>
<p>If you wish, you may associate a scope with a registry; see below.</p>
<h3 id="publishing-public-scoped-packages-to-the-public-npm-registry">Publishing public scoped packages to the public npm registry</h3>
<p>To publish a public scoped package, you must specify <code>--access public</code> with
the initial publication. This will publish the package and set access
to <code>public</code> as if you had run <code>npm access public</code> after publishing.</p>
<h3 id="publishing-private-scoped-packages-to-the-npm-registry">Publishing private scoped packages to the npm registry</h3>
<p>To publish a private scoped package to the npm registry, you must have
an <a href="https://www.npmjs.com/private-modules">npm Private Modules</a>
account.</p>
<p>You can then publish the module with <code>npm publish</code> or <code>npm publish
--access restricted</code>, and it will be present in the npm registry, with
restricted access. You can then change the access permissions, if
desired, with <code>npm access</code> or on the npmjs.com website.</p>
<h2 id="associating-a-scope-with-a-registry">Associating a scope with a registry</h2>
<p>Scopes can be associated with a separate registry. This allows you to
seamlessly use a mix of packages from the public npm registry and one or more
@@ -54,5 +66,6 @@ <h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-install.html">npm-install(1)</a></li>
<li><a href="../cli/npm-publish.html">npm-publish(1)</a></li>
<li><a href="../cli/npm-access.html">npm-access(1)</a></li>
</ul>

@@ -1,13 +1,14 @@
module.exports = bin

var npm = require("./npm.js")
var osenv = require("osenv")

bin.usage = "npm bin\nnpm bin -g\n(just prints the bin folder)"

function bin (args, silent, cb) {
if (typeof cb !== "function") cb = silent, silent = false
var b = npm.bin
, PATH = (process.env.PATH || "").split(":")
, PATH = osenv.path()

if (!silent) console.log(b)
process.nextTick(cb.bind(this, null, b))
@@ -85,20 +85,26 @@ function linkStuff (pkg, folder, global, didRB, cb) {
// if it's global, and folder is in {prefix}/node_modules,
// then bins are in {prefix}/bin
// otherwise, then bins are in folder/../.bin
var parent = pkg.name[0] === "@" ? path.dirname(path.dirname(folder)) : path.dirname(folder)
, gnm = global && npm.globalDir
, gtop = parent === gnm

log.verbose("linkStuff", [global, gnm, gtop, parent])
log.info("linkStuff", pkg._id)

shouldWarn(pkg, folder, global, function() {
asyncMap( [linkBins, linkMans, !didRB && rebuildBundles]
, function (fn, cb) {
if (!fn) return cb()
log.verbose(fn.name, pkg._id)
fn(pkg, folder, parent, gtop, cb)
}, cb)
var parent = pkg.name[0] === '@' ? path.dirname(path.dirname(folder)) : path.dirname(folder)
var gnm = global && npm.globalDir
var gtop = parent === gnm

log.info('linkStuff', pkg._id)
log.silly('linkStuff', pkg._id, 'has', parent, 'as its parent node_modules')
if (global) log.silly('linkStuff', pkg._id, 'is part of a global install')
if (gnm) log.silly('linkStuff', pkg._id, 'is installed into a global node_modules')
if (gtop) log.silly('linkStuff', pkg._id, 'is installed into the top-level global node_modules')

shouldWarn(pkg, folder, global, function () {
asyncMap(
[linkBins, linkMans, !didRB && rebuildBundles],
function (fn, cb) {
if (!fn) return cb()
log.verbose(fn.name, pkg._id)
fn(pkg, folder, parent, gtop, cb)
},
cb
)
})
}

@@ -76,7 +76,6 @@ var npm = require("./npm.js")
, addLocal = require("./cache/add-local.js")
, addRemoteTarball = require("./cache/add-remote-tarball.js")
, addRemoteGit = require("./cache/add-remote-git.js")
, maybeGithub = require("./cache/maybe-github.js")
, inflight = require("inflight")
, realizePackageSpecifier = require("realize-package-specifier")
, npa = require("npm-package-arg")
@@ -135,9 +134,7 @@ function read (name, ver, forceBypass, cb) {

var root = cachedPackageRoot({name : name, version : ver})
function c (er, data) {
log.silly("cache", "addNamed cb", name+"@"+ver)
if (er) log.verbose("cache", "addNamed error for", name+"@"+ver, er)

if (data) deprCheck(data)

return cb(er, data)
@@ -298,14 +295,8 @@ function add (args, where, cb) {
})
break
case "git":
addRemoteGit(p.spec, false, cb)
break
case "hosted":
if (p.hosted.type === "github") {
maybeGithub(p.rawSpec, cb)
} else {
addRemoteGit(p.spec, false, cb)
}
addRemoteGit(p.rawSpec, cb)
break
default:
if (p.name) return addNamed(p.name, p.spec, null, cb)
@@ -34,20 +34,23 @@ function addNamed (name, version, data, cb_) {
assert(typeof cb_ === "function", "must have callback")

var key = name + "@" + version
log.verbose("addNamed", key)
log.silly("addNamed", key)

function cb (er, data) {
if (data && !data._fromGithub) data._from = key
cb_(er, data)
}

log.silly("addNamed", "semver.valid", semver.valid(version))
log.silly("addNamed", "semver.validRange", semver.validRange(version))
var fn = ( semver.valid(version, true) ? addNameVersion
: semver.validRange(version, true) ? addNameRange
: addNameTag
)
fn(name, version, data, cb)
if (semver.valid(version, true)) {
log.verbose('addNamed', JSON.stringify(version), 'is a plain semver version for', name)
addNameVersion(name, version, data, cb)
} else if (semver.validRange(version, true)) {
log.verbose('addNamed', JSON.stringify(version), 'is a valid semver range for', name)
addNameRange(name, version, data, cb)
} else {
log.verbose('addNamed', JSON.stringify(version), 'is being treated as a dist-tag for', name)
addNameTag(name, version, data, cb)
}
}

function addNameTag (name, tag, data, cb) {

Large diffs are not rendered by default.

This file was deleted.

@@ -1,82 +1,86 @@
module.exports = updateIndex

var fs = require("graceful-fs")
, assert = require("assert")
, path = require("path")
, mkdir = require("mkdirp")
, chownr = require("chownr")
, url = require("url")
, npm = require("../npm.js")
, log = require("npmlog")
, cacheFile = require("npm-cache-filename")
, getCacheStat = require("./get-stat.js")
var fs = require('graceful-fs')
var assert = require('assert')
var path = require('path')
var mkdir = require('mkdirp')
var chownr = require('chownr')
var npm = require('../npm.js')
var log = require('npmlog')
var cacheFile = require('npm-cache-filename')
var getCacheStat = require('./get-stat.js')
var mapToRegistry = require('../utils/map-to-registry.js')

/* /-/all is special.
* It uses timestamp-based caching and partial updates,
* because it is a monster.
*/
function updateIndex (uri, params, cb) {
assert(typeof uri === "string", "must pass registry URI to updateIndex")
assert(params && typeof params === "object", "must pass params to updateIndex")
assert(typeof cb === "function", "must pass callback to updateIndex")

var parsed = url.parse(uri)
assert(
parsed.protocol === "http:" || parsed.protocol === "https:",
"must have a URL that starts with http: or https:"
)

var cacheBase = cacheFile(npm.config.get("cache"))(uri)
var cachePath = path.join(cacheBase, ".cache.json")
log.info("updateIndex", cachePath)

getCacheStat(function (er, st) {
function updateIndex (staleness, cb) {
assert(typeof cb === 'function', 'must pass callback to updateIndex')

mapToRegistry('-/all', npm.config, function (er, uri, auth) {
if (er) return cb(er)

mkdir(cacheBase, function (er, made) {
if (er) return cb(er)
var params = {
timeout: staleness,
follow: true,
staleOk: true,
auth: auth
}
var cacheBase = cacheFile(npm.config.get('cache'))(uri)
var cachePath = path.join(cacheBase, '.cache.json')
log.info('updateIndex', cachePath)

fs.readFile(cachePath, function (er, data) {
if (er) return updateIndex_(uri, params, 0, {}, cachePath, cb)
getCacheStat(function (er, st) {
if (er) return cb(er)

try {
data = JSON.parse(data)
}
catch (ex) {
fs.writeFile(cachePath, "{}", function (er) {
if (er) return cb(new Error("Broken cache."))
mkdir(cacheBase, function (er, made) {
if (er) return cb(er)

return updateIndex_(uri, params, 0, {}, cachePath, cb)
fs.readFile(cachePath, function (er, data) {
if (er) {
log.warn('', 'Building the local index for the first time, please be patient')
return updateIndex_(uri, params, {}, cachePath, cb)
}

chownr(made || cachePath, st.uid, st.gid, function (er) {
if (er) return cb(er)

try {
data = JSON.parse(data)
} catch (ex) {
fs.writeFile(cachePath, '{}', function (er) {
if (er) return cb(new Error('Broken cache.'))

log.warn('', 'Building the local index for the first time, please be patient')
return updateIndex_(uri, params, {}, cachePath, cb)
})
}

var t = +data._updated || 0
// use the cache and update in the background if it's not too old
if (Date.now() - t < 60000) {
cb(null, data)
cb = function () {}
}

if (t === 0) {
log.warn('', 'Building the local index for the first time, please be patient')
} else {
log.verbose('updateIndex', 'Cached search data present with timestamp', t)
uri += '/since?stale=update_after&startkey=' + t
}
updateIndex_(uri, params, data, cachePath, cb)
})
}
var t = +data._updated || 0
chownr(made || cachePath, st.uid, st.gid, function (er) {
if (er) return cb(er)

updateIndex_(uri, params, t, data, cachePath, cb)
})
})
})
})
}

function updateIndex_ (uri, params, t, data, cachePath, cb) {
// use the cache and update in the background if it's not too old
if (Date.now() - t < 60000) {
cb(null, data)
cb = function () {}
}

var full
if (t === 0) {
log.warn("", "Building the local index for the first time, please be patient")
full = url.resolve(uri, "/-/all")
}
else {
full = url.resolve(uri, "/-/all/since?stale=update_after&startkey=" + t)
}

npm.registry.request(full, params, function (er, updates, _, res) {
function updateIndex_ (all, params, data, cachePath, cb) {
log.silly('update-index', 'fetching', all)
npm.registry.request(all, params, function (er, updates, _, res) {
if (er) return cb(er, data)

var headers = res.headers
@@ -74,8 +74,10 @@ function load () {
loading = true

cb = once(function (er, conf) {
if (!er)
if (!er) {
exports.loaded = conf
loading = false
}
loadCbs.forEach(function (fn) {
fn(er, conf)
})
@@ -196,6 +196,7 @@ Object.defineProperty(exports, "defaults", {get: function () {
, spin: true
, "strict-ssl": true
, tag : "latest"
, "tag-version-prefix" : "v"
, tmp : temp
, unicode : true
, "unsafe-perm" : process.platform === "win32"
@@ -308,15 +309,26 @@ exports.types =
, userconfig : path
, umask: Umask
, version : Boolean
, "tag-version-prefix" : String
, versions : Boolean
, viewer: String
, _exit : Boolean
}

function getLocalAddresses() {
Object.keys(os.networkInterfaces()).map(function (nic) {
return os.networkInterfaces()[nic].filter(function (addr) {
return addr.family === "IPv4"
function getLocalAddresses () {
var interfaces
// #8094: some environments require elevated permissions to enumerate
// interfaces, and synchronously throw EPERM when run without
// elevated privileges
try {
interfaces = os.networkInterfaces()
} catch (e) {
interfaces = {}
}

return Object.keys(interfaces).map(function (nic) {
return interfaces[nic].filter(function (addr) {
return addr.family === 'IPv4'
})
.map(function (addr) {
return addr.address
@@ -9,8 +9,12 @@ function loadCAFile(cafilePath, cb) {
fs.readFile(cafilePath, "utf8", afterCARead.bind(this))

function afterCARead(er, cadata) {
if (er)

if (er) {
// previous cafile no longer exists, so just continue on gracefully
if (er.code === 'ENOENT') return cb()
return cb(er)
}

var delim = "-----END CERTIFICATE-----"
var output
@@ -17,7 +17,7 @@ function init (args, cb) {
if (!initJson.yes(npm.config)) {
console.log(
["This utility will walk you through creating a package.json file."
,"It only covers the most common items, and tries to guess sane defaults."
,"It only covers the most common items, and tries to guess sensible defaults."
,""
,"See `npm help json` for definitive documentation on these fields"
,"and exactly what they do."
@@ -223,8 +223,9 @@ function install (args, cb_) {

// initial "family" is the name:version of the root, if it's got
// a package.json file.
var jsonFile = path.resolve(where, "package.json")
readJson(jsonFile, log.warn, function (er, data) {
var jsonPath = path.resolve(where, "package.json")
log.verbose('install', 'initial load of', jsonPath)
readJson(jsonPath, log.warn, function (er, data) {
if (er
&& er.code !== "ENOENT"
&& er.code !== "ENOTDIR") return cb(er)
@@ -246,7 +247,9 @@ function install (args, cb_) {
}

function validateInstall (where, cb) {
readJson(path.resolve(where, 'package.json'), log.warn, function (er, data) {
var jsonPath = path.resolve(where, 'package.json')
log.verbose('validateInstall', 'loading', jsonPath, 'for validation')
readJson(jsonPath, log.warn, function (er, data) {
if (er
&& er.code !== 'ENOENT'
&& er.code !== 'ENOTDIR') return cb(er)
@@ -314,11 +317,11 @@ function findPeerInvalid_ (packageMap, fpiList) {
function readDependencies (context, where, opts, cb) {
var wrap = context ? context.wrap : null

readJson( path.resolve(where, "package.json")
, log.warn
, function (er, data) {
var jsonPath = path.resolve(where, 'package.json')
log.verbose('readDependencies', 'loading dependencies from', jsonPath)
readJson(jsonPath, log.warn, function (er, data) {
if (er && er.code === "ENOENT") er.code = "ENOPACKAGEJSON"
if (er) return cb(er)
if (er) return cb(er)

if (opts && opts.dev) {
if (!data.dependencies) data.dependencies = {}
@@ -420,17 +423,17 @@ function save (where, installed, tree, pretty, hasArguments, cb) {
var saveTarget = path.resolve(where, "package.json")

asyncMap(Object.keys(tree), function (k, cb) {
// if "what" was a url, then save that instead.
// if "from" is remote, git, or hosted, then save that instead.
var t = tree[k]
, u = url.parse(t.from)
, f = npa(t.from)
, a = npa(t.what)
, w = [a.name, a.spec]


fs.stat(t.from, function (er){
if (!er) {
w[1] = "file:" + t.from
} else if (u && u.protocol) {
} else if (['hosted', 'git', 'remote'].indexOf(f.type) !== -1) {
w[1] = t.from
}
cb(null, [w])
@@ -472,7 +475,7 @@ function save (where, installed, tree, pretty, hasArguments, cb) {
data.bundleDependencies = bundle.sort()
}

log.verbose("saving", things)
log.verbose("save", "saving", things)
data[deps] = data[deps] || {}
Object.keys(things).forEach(function (t) {
data[deps][t] = things[t]
@@ -485,6 +488,7 @@ function save (where, installed, tree, pretty, hasArguments, cb) {

data[deps] = sortedObject(data[deps])

log.silly("save", "writing", saveTarget)
data = JSON.stringify(data, null, 2) + "\n"
writeFileAtomic(saveTarget, data, function (er) {
cb(er, installed, tree, pretty)
@@ -601,7 +605,9 @@ function installManyTop (what, where, context, cb_) {

if (context.explicit) return next()

readJson(path.join(where, "package.json"), log.warn, function (er, data) {
var jsonPath = path.join(where, 'package.json')
log.verbose('installManyTop', 'reading for lifecycle', jsonPath)
readJson(jsonPath, log.warn, function (er, data) {
if (er) return next(er)
lifecycle(data, "preinstall", where, next)
})
@@ -636,8 +642,9 @@ function installManyTop_ (what, where, context, cb) {
// recombine unscoped with @scope/package packages
asyncMap(unscoped.concat(scoped).map(function (p) {
return path.resolve(nm, p, "package.json")
}), function (jsonfile, cb) {
readJson(jsonfile, log.warn, function (er, data) {
}), function (jsonPath, cb) {
log.verbose('installManyTop', 'reading scoped package data from', jsonPath)
readJson(jsonPath, log.warn, function (er, data) {
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
if (er) return cb(null, [])
cb(null, [[data.name, data.version]])
@@ -680,19 +687,20 @@ function installMany (what, where, context, cb) {

var parent = data

var d = data.dependencies || {}

// if we're explicitly installing "what" into "where", then the shrinkwrap
// for "where" doesn't apply. This would be the case if someone were adding
// a new package to a shrinkwrapped package. (data.dependencies will not be
// used here except to indicate what packages are already present, so
// there's no harm in using that.)
if (context.explicit) wrap = null

var deps = data.dependencies || {}
var devDeps = data.devDependencies || {}

// what is a list of things.
// resolve each one.
asyncMap( what
, targetResolver(where, context, d)
, targetResolver(where, context, deps, devDeps)
, function (er, targets) {

if (er) return cb(er)
@@ -767,7 +775,7 @@ function installMany (what, where, context, cb) {
})
}

function targetResolver (where, context, deps) {
function targetResolver (where, context, deps, devDeps) {
var alreadyInstalledManually = []
, resolveLeft = 0
, nm = path.resolve(where, "node_modules")
@@ -789,7 +797,9 @@ function targetResolver (where, context, deps) {
})

asyncMap(inst, function (pkg, cb) {
readJson(path.resolve(name, pkg, "package.json"), log.warn, function (er, d) {
var jsonPath = path.resolve(name, pkg, 'package.json')
log.verbose('targetResolver', 'reading package data from', jsonPath)
readJson(jsonPath, log.warn, function (er, d) {
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
// error means it's not a package, most likely.
if (er) return cb(null, [])
@@ -798,7 +808,8 @@ function targetResolver (where, context, deps) {
// otherwise, make sure that it's a semver match with what we want.
var bd = parent.bundleDependencies
var isBundled = bd && bd.indexOf(d.name) !== -1
var currentIsSatisfactory = semver.satisfies(d.version, deps[d.name] || "*", true)
var expectedVersion = deps[d.name] || (devDeps && devDeps[d.name]) || "*"
var currentIsSatisfactory = semver.satisfies(d.version, expectedVersion, true)
if (isBundled || currentIsSatisfactory || deps[d.name] === d._resolved) {
return cb(null, d.name)
}
@@ -881,7 +892,7 @@ function targetResolver (where, context, deps) {
return cb(null, [])
}

var isGit = npa(what).type === "git"
var isGit = (npa(what).type === "git" || npa(what).type === "hosted")

if (!er &&
data &&
@@ -907,7 +918,7 @@ function installOne (target, where, context, cb) {
// the --link flag makes this a "link" command if it's at the
// the top level.
var isGit = false
if (target && target._from) isGit = npa(target._from).type === 'git'
if (target && target._from) isGit = (npa(target._from).type === 'git' || npa(target._from).type === 'hosted')

if (where === npm.prefix && npm.config.get("link")
&& !npm.config.get("global") && !isGit) {
@@ -930,11 +941,11 @@ function installOne (target, where, context, cb) {

function localLink (target, where, context, cb) {
log.verbose("localLink", target._id)
var jsonFile = path.resolve( npm.globalDir, target.name
, "package.json" )
, parent = context.parent
var jsonPath = path.resolve(npm.globalDir, target.name , 'package.json')
var parent = context.parent

readJson(jsonFile, log.warn, function (er, data) {
log.verbose('localLink', 'reading data to link', target.name, 'from', jsonPath)
readJson(jsonPath, log.warn, function (er, data) {
function thenLink () {
npm.commands.link([target.name], function (er, d) {
log.silly("localLink", "back from link", [er, d])
@@ -1057,23 +1068,24 @@ function write (target, targetFolder, context, cb_) {

log.silly("install write", "writing", target.name, target.version, "to", targetFolder)
chain(
[ [ cache.unpack, target.name, target.version, targetFolder
, null, null, user, group ]
, [ fs, "writeFile"
, path.resolve(targetFolder, "package.json")
, JSON.stringify(target, null, 2) + "\n" ]
, [ lifecycle, target, "preinstall", targetFolder ]
, function (cb) {
if (!target.bundleDependencies) return cb()

var bd = path.resolve(targetFolder, "node_modules")
fs.readdir(bd, function (er, b) {
// nothing bundled, maybe
if (er) return cb()
bundled = b || []
cb()
})
} ]
[ [ cache.unpack, target.name, target.version, targetFolder, null, null, user, group ],
function writePackageJSON (cb) {
var jsonPath = path.resolve(targetFolder, 'package.json')
log.verbose('write', 'writing to', jsonPath)
writeFileAtomic(jsonPath, JSON.stringify(target, null, 2) + '\n', cb)
},
[ lifecycle, target, "preinstall", targetFolder ],
function collectBundled (cb) {
if (!target.bundleDependencies) return cb()

var bd = path.resolve(targetFolder, "node_modules")
fs.readdir(bd, function (er, b) {
// nothing bundled, maybe
if (er) return cb()
bundled = b || []
cb()
})
} ]

// nest the chain so that we can throw away the results returned
// up until this point, since we really don't care about it.
@@ -1118,7 +1130,16 @@ function write (target, targetFolder, context, cb_) {
"in npm 3+. Your application will need to depend on it explicitly."
], pd+","+data.name)
})
var pdTargetFolder = path.resolve(targetFolder, "..", "..")

// Package scopes cause an addditional tree level which needs to be
// considered when resolving a peerDependency's target folder.
var pdTargetFolder
if (npa(target.name).scope) {
pdTargetFolder = path.resolve(targetFolder, '../../..')
} else {
pdTargetFolder = path.resolve(targetFolder, '../..')
}

var pdContext = context
if (peerDeps.length > 0) {
actions.push(
@@ -127,7 +127,7 @@ function linkPkg (folder, cb_) {
return cb(er)
}
var target = path.resolve(npm.globalDir, d.name)
symlink(me, target, function (er) {
symlink(me, target, false, true, function (er) {
if (er) return cb(er)
log.verbose("link", "build target", target)
// also install missing dependencies.
@@ -11,9 +11,6 @@ if (typeof WScript !== "undefined") {
}


// monkey-patch support for 0.6 child processes
require('child-process-close')

var EventEmitter = require("events").EventEmitter
, npm = module.exports = new EventEmitter()
, npmconf = require("./config/core.js")
@@ -301,7 +301,7 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) {
}

if (args.length && args.indexOf(dep) === -1) return skip()
var parsed = npa(req)
var parsed = npa(dep + '@' + req)
if (parsed.type === "git" || (parsed.hosted && parsed.hosted.type === "github")) {
return doIt("git", "git")
}
@@ -313,8 +313,35 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) {
npm.registry.get(uri, { auth : auth }, updateDeps)
})

function updateLocalDeps (latestRegistryVersion) {
readJson(path.resolve(parsed.spec, 'package.json'), function (er, localDependency) {
if (er) return cb()

var wanted = localDependency.version
var latest = localDependency.version

if (latestRegistryVersion) {
latest = latestRegistryVersion
if (semver.lt(wanted, latestRegistryVersion)) {
wanted = latestRegistryVersion
req = dep + '@' + latest
}
}

if (curr.version !== wanted) {
doIt(wanted, latest)
} else {
skip()
}
})
}

function updateDeps (er, d) {
if (er) return cb()
if (er) {
if (parsed.type !== 'local') return cb()
return updateLocalDeps()
}

if (!d || !d["dist-tags"] || !d.versions) return cb()
var l = d.versions[d["dist-tags"].latest]
if (!l) return cb()
@@ -355,6 +382,8 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) {
if (!curr || dFromUrl && cFromUrl && d._from !== curr.from
|| d.version !== curr.version
|| d.version !== l.version) {
if (parsed.type === 'local') return updateLocalDeps(l.version)

doIt(d.version, l.version)
}
else {
@@ -7,13 +7,12 @@ var npm = require("./npm.js")
, readJson = require("read-package-json")
, lifecycle = require("./utils/lifecycle.js")
, chain = require("slide").chain
, Conf = require("./config/core.js").Conf
, CachingRegClient = require("./cache/caching-client.js")
, mapToRegistry = require("./utils/map-to-registry.js")
, cachedPackageRoot = require("./cache/cached-package-root.js")
, createReadStream = require("graceful-fs").createReadStream
, npa = require("npm-package-arg")
, semver = require('semver')
, getPublishConfig = require("./utils/get-publish-config.js")

publish.usage = "npm publish <tarball> [--tag <tagname>]"
+ "\nnpm publish <folder> [--tag <tagname>]"
@@ -83,22 +82,13 @@ function cacheAddPublish (dir, didPre, isRetry, cb) {
function publish_ (arg, data, isRetry, cachedir, cb) {
if (!data) return cb(new Error("no package.json file found"))

var registry = npm.registry
var config = npm.config

// check for publishConfig hash
if (data.publishConfig) {
config = new Conf(npm.config)
config.save = npm.config.save.bind(npm.config)

// don't modify the actual publishConfig object, in case we have
// to set a login token or some other data.
config.unshift(Object.keys(data.publishConfig).reduce(function (s, k) {
s[k] = data.publishConfig[k]
return s
}, {}))
registry = new CachingRegClient(config)
}
var mappedConfig = getPublishConfig(
data.publishConfig,
npm.config,
npm.registry
)
var config = mappedConfig.config
var registry = mappedConfig.client

data._npmVersion = npm.version
data._nodeVersion = process.versions.node
@@ -13,7 +13,6 @@ runScript.completion = function (opts, cb) {

// see if there's already a package specified.
var argv = opts.conf.argv.remain
, installedShallow = require("./utils/completion/installed-shallow.js")

if (argv.length >= 4) return cb()

@@ -41,33 +40,11 @@ runScript.completion = function (opts, cb) {
})
}

// complete against the installed-shallow, and the pwd's scripts.
// but only packages that have scripts
var installed
, scripts
installedShallow(opts, function (d) {
return d.scripts
}, function (er, inst) {
installed = inst
next()
})

if (npm.config.get("global")) {
scripts = []
next()
}
else readJson(path.join(npm.localPrefix, "package.json"), function (er, d) {
readJson(path.join(npm.localPrefix, "package.json"), function (er, d) {
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
d = d || {}
scripts = Object.keys(d.scripts || {})
next()
cb(null, Object.keys(d.scripts || {}))
})

function next () {
if (!installed || !scripts) return

cb(null, scripts.concat(installed))
}
}

function runScript (args, cb) {
@@ -189,8 +166,7 @@ function run (pkg, wd, cmd, args, cb) {
function joinArgs (args) {
var joinedArgs = ""
args.forEach(function(arg) {
if (arg.match(/[ '"]/)) arg = '"' + arg.replace(/"/g, '\\"') + '"'
joinedArgs += " " + arg
joinedArgs += ' "' + arg.replace(/"/g, '\\"') + '"'
})
return joinedArgs
}
@@ -3,7 +3,6 @@ module.exports = exports = search

var npm = require("./npm.js")
, columnify = require("columnify")
, mapToRegistry = require("./utils/map-to-registry.js")
, updateIndex = require("./cache/update-index.js")

search.usage = "npm search [some search terms ...]"
@@ -35,19 +34,24 @@ function search (args, silent, staleness, cb) {
if (typeof cb !== "function") cb = silent, silent = false

var searchopts = npm.config.get("searchopts")
, searchexclude = npm.config.get("searchexclude")
var searchexclude = npm.config.get("searchexclude")

if (typeof searchopts !== "string") searchopts = ""
searchopts = searchopts.split(/\s+/)
if (typeof searchexclude === "string") {
searchexclude = searchexclude.split(/\s+/)
} else searchexclude = []
var opts = searchopts.concat(args).map(function (s) {
return s.toLowerCase()
}).filter(function (s) { return s })

if (typeof searchexclude === "string") {
searchexclude = searchexclude.split(/\s+/)
} else {
searchexclude = []
}
searchexclude = searchexclude.map(function (s) {
return s.toLowerCase()
})
getFilteredData( staleness, opts, searchexclude, function (er, data) {

getFilteredData(staleness, opts, searchexclude, function (er, data) {
// now data is the list of data that we want to show.
// prettify and print it, and then provide the raw
// data to the cb.
@@ -58,19 +62,9 @@ function search (args, silent, staleness, cb) {
}

function getFilteredData (staleness, args, notArgs, cb) {
mapToRegistry("-/all", npm.config, function (er, uri, auth) {
updateIndex(staleness, function (er, data) {
if (er) return cb(er)

var params = {
timeout : staleness,
follow : true,
staleOk : true,
auth : auth
}
updateIndex(uri, params, function (er, data) {
if (er) return cb(er)
return cb(null, filter(data, args, notArgs))
})
return cb(null, filter(data, args, notArgs))
})
}

@@ -30,7 +30,6 @@ function unbuild_ (silent) { return function (folder, cb_) {
readJson(path.resolve(folder, "package.json"), function (er, pkg) {
// if no json, then just trash it, but no scripts or whatever.
if (er) return gentlyRm(folder, false, base, cb)
readJson.cache.del(folder)
chain
( [ [lifecycle, pkg, "preuninstall", folder, false, true]
, [lifecycle, pkg, "uninstall", folder, false, true]
@@ -53,8 +52,6 @@ function rmStuff (pkg, folder, cb) {
, gnm = npm.dir
, top = gnm === parent

readJson.cache.del(path.resolve(folder, "package.json"))

log.verbose("unbuild rmStuff", pkg._id, "from", gnm)
if (!top) log.verbose("unbuild rmStuff", "in", parent)
asyncMap([rmBins, rmMans], function (fn, cb) {
@@ -2,11 +2,12 @@
module.exports = unpublish

var log = require("npmlog")
, npm = require("./npm.js")
, readJson = require("read-package-json")
, path = require("path")
, mapToRegistry = require("./utils/map-to-registry.js")
, npa = require("npm-package-arg")
var npm = require("./npm.js")
var readJson = require("read-package-json")
var path = require("path")
var mapToRegistry = require("./utils/map-to-registry.js")
var npa = require("npm-package-arg")
var getPublishConfig = require("./utils/get-publish-config.js")

unpublish.usage = "npm unpublish <project>[@<version>]"

@@ -71,34 +72,44 @@ function unpublish (args, cb) {
return readJson(cwdJson, function (er, data) {
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
if (er) return cb("Usage:\n" + unpublish.usage)
gotProject(data.name, data.version, cb)
log.verbose('unpublish', data)
gotProject(data.name, data.version, data.publishConfig, cb)
})
}
return gotProject(project, version, cb)
}

function gotProject (project, version, cb_) {
function gotProject (project, version, publishConfig, cb_) {
if (typeof cb_ !== 'function') {
cb_ = publishConfig
publishConfig = null
}

function cb (er) {
if (er) return cb_(er)
console.log("- " + project + (version ? "@" + version : ""))
cb_()
}

var mappedConfig = getPublishConfig(publishConfig, npm.config, npm.registry)
var config = mappedConfig.config
var registry = mappedConfig.client

// remove from the cache first
npm.commands.cache(["clean", project, version], function (er) {
if (er) {
log.error("unpublish", "Failed to clean cache")
return cb(er)
}

mapToRegistry(project, npm.config, function (er, uri, auth) {
mapToRegistry(project, config, function (er, uri, auth) {
if (er) return cb(er)

var params = {
version : version,
auth : auth
version: version,
auth: auth
}
npm.registry.unpublish(uri, params, cb)
registry.unpublish(uri, params, cb)
})
})
}
@@ -0,0 +1,25 @@
var Conf = require('../config/core.js').Conf
var CachingRegClient = require('../cache/caching-client.js')
var log = require('npmlog')

module.exports = getPublishConfig

function getPublishConfig (publishConfig, defaultConfig, defaultClient) {
var config = defaultConfig
var client = defaultClient
log.verbose('getPublishConfig', publishConfig)
if (publishConfig) {
config = new Conf(defaultConfig)
config.save = defaultConfig.save.bind(defaultConfig)

// don't modify the actual publishConfig object, in case we have
// to set a login token or some other data.
config.unshift(Object.keys(publishConfig).reduce(function (s, k) {
s[k] = publishConfig[k]
return s
}, {}))
client = new CachingRegClient(config)
}

return { config: config, client: client }
}
@@ -20,11 +20,7 @@ function prefixGitArgs () {
function execGit (args, options, cb) {
log.info('git', args)
var fullArgs = prefixGitArgs().concat(args || [])
return exec(git, fullArgs, options, function (err) {
if (err) log.error('git', fullArgs.join(' '))

cb.apply(null, arguments)
})
return exec(git, fullArgs, options, cb)
}

function spawnGit (args, options) {
@@ -16,13 +16,14 @@ function linkIfExists (from, to, gently, cb) {
})
}

function link (from, to, gently, cb) {
function link (from, to, gently, abs, cb) {
if (typeof cb !== "function") cb = abs, abs = false
if (typeof cb !== "function") cb = gently, gently = null
if (npm.config.get("force")) gently = false

to = path.resolve(to)
var target = from = path.resolve(from)
if (process.platform !== "win32") {
if (!abs && process.platform !== "win32") {
// junctions on windows must be absolute
target = path.relative(path.dirname(to), from)
// if there is no folder in common, then it will be much
@@ -11,7 +11,18 @@ function spawn (cmd, args, options) {
er.file = cmd
cooked.emit("error", er)
}).on("close", function (code, signal) {
cooked.emit("close", code, signal)
// Create ENOENT error because Node.js v0.8 will not emit
// an `error` event if the command could not be found.
if (code === 127) {
var er = new Error('spawn ENOENT')
er.code = 'ENOENT'
er.errno = 'ENOENT'
er.syscall = 'spawn'
er.file = cmd
cooked.emit('error', er)
} else {
cooked.emit("close", code, signal)
}
})

cooked.stdin = raw.stdin
@@ -155,7 +155,7 @@ function commit (version, hasShrinkwrap, cb) {
git.chainableExec([ "add", "package.json" ], options),
hasShrinkwrap && git.chainableExec([ "add", "npm-shrinkwrap.json" ] , options),
git.chainableExec([ "commit", "-m", message ], options),
git.chainableExec([ "tag", "v" + version, flag, message ], options)
git.chainableExec([ "tag", npm.config.get("tag-version-prefix") + version, flag, message ], options)
],
cb
)
@@ -1,4 +1,4 @@
.TH "NPM" "1" "March 2015" "" ""
.TH "NPM" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm\fR \- a JavaScript package manager
.P
@@ -38,7 +38,7 @@ Here's an example using curl:
.P
.RS 2
.nf
curl \-L https://npmjs\.com/install\.sh | sh
curl \-L https://www\.npmjs\.com/install\.sh | sh
.fi
.RE
.SS Slightly Fancier
@@ -69,11 +69,11 @@ run npm commands by doing \fBnode cli\.js <cmd> <args>\fR\|\. (This is helpful
for testing, or running stuff without actually installing npm itself\.)
.SH Windows Install or Upgrade
.P
You can download a zip file from https://github\.com/npm/npm/releases, and unpack it
in the same folder where node\.exe lives\.
You can download a zip file from https://github\.com/npm/npm/releases, and
unpack it in the \fBnode_modules\\npm\\\fR folder inside node's installation folder\.
.P
The latest version in a zip file is 1\.4\.12\. To upgrade to npm 2, follow the
Windows upgrade instructions in the npm Troubleshooting Guide:
To upgrade to npm 2, follow the Windows upgrade instructions in
the npm Troubleshooting Guide:
.P
https://github\.com/npm/npm/wiki/Troubleshooting#upgrading\-on\-windows
.P
@@ -1,4 +1,4 @@
.TH "NPM\-ACCESS" "1" "March 2015" "" ""
.TH "NPM\-ACCESS" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-access\fR \- Set access level on published packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-ADDUSER" "1" "March 2015" "" ""
.TH "NPM\-ADDUSER" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-adduser\fR \- Add a registry user account
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-BIN" "1" "March 2015" "" ""
.TH "NPM\-BIN" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-bin\fR \- Display npm bin folder
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-BUGS" "1" "March 2015" "" ""
.TH "NPM\-BUGS" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-BUILD" "1" "March 2015" "" ""
.TH "NPM\-BUILD" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-build\fR \- Build a package
.SH SYNOPSIS
@@ -18,7 +18,14 @@ A folder containing a \fBpackage\.json\fR file in its root\.
.P
This is the plumbing command called by \fBnpm link\fR and \fBnpm install\fR\|\.
.P
It should generally not be called directly\.
It should generally be called during installation, but if you need to run it
directly, run:
.P
.RS 2
.nf
npm run\-script build
.fi
.RE
.SH SEE ALSO
.RS 0
.IP \(bu 2
@@ -1,4 +1,4 @@
.TH "NPM\-BUNDLE" "1" "March 2015" "" ""
.TH "NPM\-BUNDLE" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-bundle\fR \- REMOVED
.SH DESCRIPTION
@@ -1,4 +1,4 @@
.TH "NPM\-CACHE" "1" "March 2015" "" ""
.TH "NPM\-CACHE" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-cache\fR \- Manipulates packages cache
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-COMPLETION" "1" "March 2015" "" ""
.TH "NPM\-COMPLETION" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-completion\fR \- Tab Completion for npm
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-CONFIG" "1" "March 2015" "" ""
.TH "NPM\-CONFIG" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-config\fR \- Manage the npm configuration files
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-DEDUPE" "1" "March 2015" "" ""
.TH "NPM\-DEDUPE" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-dedupe\fR \- Reduce duplication
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-DEPRECATE" "1" "March 2015" "" ""
.TH "NPM\-DEPRECATE" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-deprecate\fR \- Deprecate a version of a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-DIST\-TAG" "1" "March 2015" "" ""
.TH "NPM\-DIST\-TAG" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-dist-tag\fR \- Modify package distribution tags
.SH SYNOPSIS
@@ -47,7 +47,8 @@ npm install \-\-tag <tag>
.P
This also applies to \fBnpm dedupe\fR\|\.
.P
Publishing a package always sets the "latest" tag to the published version\.
Publishing a package sets the "latest" tag to the published version unless the
\fB\-\-tag\fR option is used\. For example, \fBnpm publish \-\-tag=beta\fR\|\.
.SH PURPOSE
.P
Tags can be used to provide an alias instead of version numbers\. For
@@ -1,4 +1,4 @@
.TH "NPM\-DOCS" "1" "March 2015" "" ""
.TH "NPM\-DOCS" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-docs\fR \- Docs for a package in a web browser maybe
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-EDIT" "1" "March 2015" "" ""
.TH "NPM\-EDIT" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-edit\fR \- Edit an installed package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-EXPLORE" "1" "March 2015" "" ""
.TH "NPM\-EXPLORE" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-explore\fR \- Browse an installed package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-HELP\-SEARCH" "1" "March 2015" "" ""
.TH "NPM\-HELP\-SEARCH" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-help-search\fR \- Search npm help documentation
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-HELP" "1" "March 2015" "" ""
.TH "NPM\-HELP" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-help\fR \- Get help on npm
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-INIT" "1" "March 2015" "" ""
.TH "NPM\-INIT" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-init\fR \- Interactively create a package\.json file
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-INSTALL" "1" "March 2015" "" ""
.TH "NPM\-INSTALL" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-install\fR \- Install a package
.SH SYNOPSIS
@@ -191,16 +191,60 @@ fetch the package by name if it is not valid\.
npm install mygithubuser/myproject
.fi
.RE
To reference a package in a git repo that is not on GitHub, see git
remote urls below\.
To reference a package in a generic git repo (not on GitHub), see git remote
urls below\.
.IP \(bu 2
\fBnpm install github:<githubname>/<githubrepo>\fR:
The same as the above, but explicitly marked as a GitHub dependency\.
Example:
.P
.RS 2
.nf
npm install github:npm/npm
.fi
.RE
.IP \(bu 2
\fBnpm install gist:[<githubname>/]<gistID>\fR:
Install the package at \fBhttps://gist\.github\.com/gistID\fR by attempting to
clone it using \fBgit\fR\|\. The GitHub username associated with the gist is
optional and will not be saved in \fBpackage\.json\fR if \fB\-\-save\fR is used\.
Example:
.P
.RS 2
.nf
npm install gist:101a11beef
.fi
.RE
.IP \(bu 2
\fBnpm install bitbucket:<bitbucketname>/<bitbucketrepo>\fR:
Install the package at \fBhttps://bitbucket\.org/bitbucketname/bitbucketrepo\fR
by attempting to clone it using \fBgit\fR\|\.
Example:
.P
.RS 2
.nf
npm install bitbucket:mybitbucketuser/myproject
.fi
.RE
.IP \(bu 2
\fBnpm install gitlab:<gitlabname>/<gitlabrepo>\fR:
Install the package at \fBhttps://gitlab\.com/gitlabname/gitlabrepo\fR
by attempting to clone it using \fBgit\fR\|\.
Example:
.P
.RS 2
.nf
npm install gitlab:mygitlabuser/myproject
.fi
.RE
.IP \(bu 2
\fBnpm install <git remote url>\fR:
Install a package by cloning a git remote url\. The format of the git
url is:
.P
.RS 2
.nf
<protocol>://[<user>@]<hostname><separator><path>[#<commit\-ish>]
<protocol>://[<user>[:<password>]@]<hostname><separator><path>[#<commit\-ish>]
.fi
.RE
\fB<protocol>\fR is one of \fBgit\fR, \fBgit+ssh\fR, \fBgit+http\fR, or
@@ -1,4 +1,4 @@
.TH "NPM\-LINK" "1" "March 2015" "" ""
.TH "NPM\-LINK" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-link\fR \- Symlink a package folder
.SH SYNOPSIS
@@ -46,7 +46,7 @@ npm link redis # link\-install the package
.P
Now, any changes to ~/projects/node\-redis will be reflected in
~/projects/node\-bloggy/node_modules/node\-redis/\. Note that the link should
be to the package name, not the directory name for that package\.
be to the package name, not the directory name for that package\.
.P
You may also shortcut the two steps in one\. For example, to do the
above use\-case in a shorter way:
@@ -1,4 +1,4 @@
.TH "NPM\-LOGOUT" "1" "March 2015" "" ""
.TH "NPM\-LOGOUT" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-logout\fR \- Log out of the registry
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-LS" "1" "March 2015" "" ""
.TH "NPM\-LS" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-ls\fR \- List installed packages
.SH SYNOPSIS
@@ -23,7 +23,7 @@ For example, running \fBnpm ls promzard\fR in npm's source tree will show:
.P
.RS 2
.nf
npm@2.7.4 /path/to/npm
npm@2.9.1 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
@@ -1,4 +1,4 @@
.TH "NPM\-OUTDATED" "1" "March 2015" "" ""
.TH "NPM\-OUTDATED" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-outdated\fR \- Check for outdated packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-OWNER" "1" "March 2015" "" ""
.TH "NPM\-OWNER" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-owner\fR \- Manage package owners
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-PACK" "1" "March 2015" "" ""
.TH "NPM\-PACK" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-pack\fR \- Create a tarball from a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-PREFIX" "1" "March 2015" "" ""
.TH "NPM\-PREFIX" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-prefix\fR \- Display prefix
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-PRUNE" "1" "March 2015" "" ""
.TH "NPM\-PRUNE" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-prune\fR \- Remove extraneous packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-PUBLISH" "1" "March 2015" "" ""
.TH "NPM\-PUBLISH" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-publish\fR \- Publish a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-REBUILD" "1" "March 2015" "" ""
.TH "NPM\-REBUILD" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-rebuild\fR \- Rebuild a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-REPO" "1" "March 2015" "" ""
.TH "NPM\-REPO" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-repo\fR \- Open package repository page in the browser
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-RESTART" "1" "March 2015" "" ""
.TH "NPM\-RESTART" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-restart\fR \- Restart a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-RM" "1" "March 2015" "" ""
.TH "NPM\-RM" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-rm\fR \- Remove a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-ROOT" "1" "March 2015" "" ""
.TH "NPM\-ROOT" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-root\fR \- Display npm root
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-RUN\-SCRIPT" "1" "March 2015" "" ""
.TH "NPM\-RUN\-SCRIPT" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-run-script\fR \- Run arbitrary package scripts
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-SEARCH" "1" "March 2015" "" ""
.TH "NPM\-SEARCH" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-search\fR \- Search for packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-SHRINKWRAP" "1" "March 2015" "" ""
.TH "NPM\-SHRINKWRAP" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-shrinkwrap\fR \- Lock down dependency versions
.SH SYNOPSIS
@@ -12,10 +12,10 @@ npm shrinkwrap
.P
This command locks down the versions of a package's dependencies so
that you can control exactly which versions of each dependency will be
used when your package is installed\. The "package\.json" file is still
required if you want to use "npm install"\.
used when your package is installed\. The \fBpackage\.json\fR file is still
required if you want to use \fBnpm install\fR\|\.
.P
By default, "npm install" recursively installs the target's
By default, \fBnpm install\fR recursively installs the target's
dependencies (as specified in package\.json), choosing the latest
available version that satisfies the dependency's semver pattern\. In
some situations, particularly when shipping software where each change
@@ -68,7 +68,7 @@ and package C:
.RE
.P
If these are the only versions of A, B, and C available in the
registry, then a normal "npm install A" will install:
registry, then a normal \fBnpm install A\fR will install:
.P
.RS 2
.nf
@@ -78,7 +78,7 @@ A@0\.1\.0
.fi
.RE
.P
However, if B@0\.0\.2 is published, then a fresh "npm install A" will
However, if B@0\.0\.2 is published, then a fresh \fBnpm install A\fR will
install:
.P
.RS 2
@@ -127,7 +127,7 @@ This generates npm\-shrinkwrap\.json, which will look something like this:
.RE
.P
The shrinkwrap command has locked down the dependencies based on
what's currently installed in node_modules\. When "npm install"
what's currently installed in node_modules\. When \fBnpm install\fR
installs a package with a npm\-shrinkwrap\.json file in the package
root, the shrinkwrap file (rather than package\.json files) completely
drives the installation of that package and all of its dependencies
@@ -138,30 +138,30 @@ files\.
.SS Using shrinkwrapped packages
.P
Using a shrinkwrapped package is no different than using any other
package: you can "npm install" it by hand, or add a dependency to your
package\.json file and "npm install" it\.
package: you can \fBnpm install\fR it by hand, or add a dependency to your
package\.json file and \fBnpm install\fR it\.
.SS Building shrinkwrapped packages
.P
To shrinkwrap an existing package:
.RS 0
.IP 1. 3
Run "npm install" in the package root to install the current
Run \fBnpm install\fR in the package root to install the current
versions of all dependencies\.
.IP 2. 3
Validate that the package works as expected with these versions\.
.IP 3. 3
Run "npm shrinkwrap", add npm\-shrinkwrap\.json to git, and publish
Run \fBnpm shrinkwrap\fR, add npm\-shrinkwrap\.json to git, and publish
your package\.

.RE
.P
To add or update a dependency in a shrinkwrapped package:
.RS 0
.IP 1. 3
Run "npm install" in the package root to install the current
Run \fBnpm install\fR in the package root to install the current
versions of all dependencies\.
.IP 2. 3
Add or update dependencies\. "npm install" each new or updated
Add or update dependencies\. \fBnpm install\fR each new or updated
package individually and then update package\.json\. Note that they
must be explicitly named in order to be installed: running \fBnpm
install\fR with no arguments will merely reproduce the existing
@@ -170,7 +170,7 @@ shrinkwrap\.
Validate that the package works as expected with the new
dependencies\.
.IP 4. 3
Run "npm shrinkwrap", commit the new npm\-shrinkwrap\.json, and
Run \fBnpm shrinkwrap\fR, commit the new npm\-shrinkwrap\.json, and
publish your package\.

.RE
@@ -180,13 +180,13 @@ available\.
.SS Other Notes
.P
A shrinkwrap file must be consistent with the package's package\.json
file\. "npm shrinkwrap" will fail if required dependencies are not
file\. \fBnpm shrinkwrap\fR will fail if required dependencies are not
already installed, since that would result in a shrinkwrap that
wouldn't actually work\. Similarly, the command will fail if there are
extraneous packages (not referenced by package\.json), since that would
indicate that package\.json is not correct\.
.P
Since "npm shrinkwrap" is intended to lock down your dependencies for
Since \fBnpm shrinkwrap\fR is intended to lock down your dependencies for
production use, \fBdevDependencies\fR will not be included unless you
explicitly set the \fB\-\-dev\fR flag when you run \fBnpm shrinkwrap\fR\|\. If
installed \fBdevDependencies\fR are excluded, then npm will print a
@@ -1,4 +1,4 @@
.TH "NPM\-STAR" "1" "March 2015" "" ""
.TH "NPM\-STAR" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-star\fR \- Mark your favorite packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-STARS" "1" "March 2015" "" ""
.TH "NPM\-STARS" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-stars\fR \- View packages marked as favorites
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-START" "1" "March 2015" "" ""
.TH "NPM\-START" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-start\fR \- Start a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-STOP" "1" "March 2015" "" ""
.TH "NPM\-STOP" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-stop\fR \- Stop a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-TAG" "1" "March 2015" "" ""
.TH "NPM\-TAG" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-tag\fR \- Tag a published version
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-TEST" "1" "March 2015" "" ""
.TH "NPM\-TEST" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-test\fR \- Test a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-RM" "1" "March 2015" "" ""
.TH "NPM\-RM" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-rm\fR \- Remove a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-UNPUBLISH" "1" "March 2015" "" ""
.TH "NPM\-UNPUBLISH" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-unpublish\fR \- Remove a package from the registry
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-UPDATE" "1" "March 2015" "" ""
.TH "NPM\-UPDATE" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-update\fR \- Update a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-VERSION" "1" "March 2015" "" ""
.TH "NPM\-VERSION" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-version\fR \- Bump a package version
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-VIEW" "1" "March 2015" "" ""
.TH "NPM\-VIEW" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-view\fR \- View registry info
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-WHOAMI" "1" "March 2015" "" ""
.TH "NPM\-WHOAMI" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-whoami\fR \- Display npm username
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM" "1" "March 2015" "" ""
.TH "NPM" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm\fR \- javascript package manager
.SH SYNOPSIS
@@ -10,7 +10,7 @@ npm <command> [args]
.RE
.SH VERSION
.P
2.7.4
2.9.1
.SH DESCRIPTION
.P
npm is the package manager for the Node JavaScript platform\. It puts
@@ -1,4 +1,4 @@
.TH "NPM\-BIN" "3" "March 2015" "" ""
.TH "NPM\-BIN" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-bin\fR \- Display npm bin folder
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-BUGS" "3" "March 2015" "" ""
.TH "NPM\-BUGS" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-CACHE" "3" "March 2015" "" ""
.TH "NPM\-CACHE" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-cache\fR \- manage the npm cache programmatically
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-COMMANDS" "3" "March 2015" "" ""
.TH "NPM\-COMMANDS" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-commands\fR \- npm commands
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-CONFIG" "3" "March 2015" "" ""
.TH "NPM\-CONFIG" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-config\fR \- Manage the npm configuration files
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-DEPRECATE" "3" "March 2015" "" ""
.TH "NPM\-DEPRECATE" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-deprecate\fR \- Deprecate a version of a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-DOCS" "3" "March 2015" "" ""
.TH "NPM\-DOCS" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-docs\fR \- Docs for a package in a web browser maybe
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-EDIT" "3" "March 2015" "" ""
.TH "NPM\-EDIT" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-edit\fR \- Edit an installed package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-EXPLORE" "3" "March 2015" "" ""
.TH "NPM\-EXPLORE" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-explore\fR \- Browse an installed package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-HELP\-SEARCH" "3" "March 2015" "" ""
.TH "NPM\-HELP\-SEARCH" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-help-search\fR \- Search the help pages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM" "" "March 2015" "" ""
.TH "NPM" "" "May 2015" "" ""
.SH "NAME"
\fBnpm\fR
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-INSTALL" "3" "March 2015" "" ""
.TH "NPM\-INSTALL" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-install\fR \- install a package programmatically
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-LINK" "3" "March 2015" "" ""
.TH "NPM\-LINK" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-link\fR \- Symlink a package folder
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-LOAD" "3" "March 2015" "" ""
.TH "NPM\-LOAD" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-load\fR \- Load config settings
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-LS" "3" "March 2015" "" ""
.TH "NPM\-LS" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-ls\fR \- List installed packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-OUTDATED" "3" "March 2015" "" ""
.TH "NPM\-OUTDATED" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-outdated\fR \- Check for outdated packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-OWNER" "3" "March 2015" "" ""
.TH "NPM\-OWNER" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-owner\fR \- Manage package owners
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-PACK" "3" "March 2015" "" ""
.TH "NPM\-PACK" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-pack\fR \- Create a tarball from a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-PREFIX" "3" "March 2015" "" ""
.TH "NPM\-PREFIX" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-prefix\fR \- Display prefix
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-PRUNE" "3" "March 2015" "" ""
.TH "NPM\-PRUNE" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-prune\fR \- Remove extraneous packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-PUBLISH" "3" "March 2015" "" ""
.TH "NPM\-PUBLISH" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-publish\fR \- Publish a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-REBUILD" "3" "March 2015" "" ""
.TH "NPM\-REBUILD" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-rebuild\fR \- Rebuild a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-REPO" "3" "March 2015" "" ""
.TH "NPM\-REPO" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-repo\fR \- Open package repository page in the browser
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-RESTART" "3" "March 2015" "" ""
.TH "NPM\-RESTART" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-restart\fR \- Restart a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-ROOT" "3" "March 2015" "" ""
.TH "NPM\-ROOT" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-root\fR \- Display npm root
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-RUN\-SCRIPT" "3" "March 2015" "" ""
.TH "NPM\-RUN\-SCRIPT" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-run-script\fR \- Run arbitrary package scripts
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-SEARCH" "3" "March 2015" "" ""
.TH "NPM\-SEARCH" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-search\fR \- Search for packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-SHRINKWRAP" "3" "March 2015" "" ""
.TH "NPM\-SHRINKWRAP" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-shrinkwrap\fR \- programmatically generate package shrinkwrap file
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-START" "3" "March 2015" "" ""
.TH "NPM\-START" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-start\fR \- Start a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-STOP" "3" "March 2015" "" ""
.TH "NPM\-STOP" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-stop\fR \- Stop a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-TAG" "3" "March 2015" "" ""
.TH "NPM\-TAG" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-tag\fR \- Tag a published version
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-TEST" "3" "March 2015" "" ""
.TH "NPM\-TEST" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-test\fR \- Test a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-UNINSTALL" "3" "March 2015" "" ""
.TH "NPM\-UNINSTALL" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-uninstall\fR \- uninstall a package programmatically
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-UNPUBLISH" "3" "March 2015" "" ""
.TH "NPM\-UNPUBLISH" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-unpublish\fR \- Remove a package from the registry
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-UPDATE" "3" "March 2015" "" ""
.TH "NPM\-UPDATE" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-update\fR \- Update a package
.SH SYNOPSIS
@@ -8,7 +8,7 @@
npm\.commands\.update(packages, callback)
.fi
.RE
.TH "DESCRIPTION" "" "March 2015" "" ""
.TH "DESCRIPTION" "" "May 2015" "" ""
.SH "NAME"
\fBDESCRIPTION\fR
.P
@@ -1,4 +1,4 @@
.TH "NPM\-VERSION" "3" "March 2015" "" ""
.TH "NPM\-VERSION" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-version\fR \- Bump a package version
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-VIEW" "3" "March 2015" "" ""
.TH "NPM\-VIEW" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-view\fR \- View registry info
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-WHOAMI" "3" "March 2015" "" ""
.TH "NPM\-WHOAMI" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-whoami\fR \- Display npm username
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM" "3" "March 2015" "" ""
.TH "NPM" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm\fR \- javascript package manager
.SH SYNOPSIS
@@ -20,7 +20,7 @@ npm\.load([configObject, ]function (er, npm) {
.RE
.SH VERSION
.P
2.7.4
2.9.1
.SH DESCRIPTION
.P
This is the API documentation for npm\.
@@ -1,4 +1,4 @@
.TH "NPM\-FOLDERS" "5" "March 2015" "" ""
.TH "NPM\-FOLDERS" "5" "May 2015" "" ""
.SH "NAME"
\fBnpm-folders\fR \- Folder Structures Used by npm
.SH DESCRIPTION
@@ -1,4 +1,4 @@
.TH "NPM\-FOLDERS" "5" "March 2015" "" ""
.TH "NPM\-FOLDERS" "5" "May 2015" "" ""
.SH "NAME"
\fBnpm-folders\fR \- Folder Structures Used by npm
.SH DESCRIPTION
@@ -1,4 +1,4 @@
.TH "PACKAGE\.JSON" "5" "March 2015" "" ""
.TH "PACKAGE\.JSON" "5" "May 2015" "" ""
.SH "NAME"
\fBpackage.json\fR \- Specifics of npm's package\.json handling
.SH DESCRIPTION
@@ -16,17 +16,32 @@ them\. The name and version together form an identifier that is assumed
to be completely unique\. Changes to the package should come along with
changes to the version\.
.P
The name is what your thing is called\. Some tips:
The name is what your thing is called\.
.P
Some rules:
.RS 0
.IP \(bu 2
The name must be shorter than 214 characters\. This includes the scope for
scoped packages\.
.IP \(bu 2
The name can't start with a dot or an underscore\.
.IP \(bu 2
New packages must not have uppercase letters in the name\.
.IP \(bu 2
The name ends up being part of a URL, an argument on the command line, and a
folder name\. Therefore, the name can't contain any non\-URL\-safe characters\.

.RE
.P
Some tips:
.RS 0
.IP \(bu 2
Don't use the same name as a core Node module\.
.IP \(bu 2
Don't put "js" or "node" in the name\. It's assumed that it's js, since you're
writing a package\.json file, and you can specify the engine using the "engines"
field\. (See below\.)
.IP \(bu 2
The name ends up being part of a URL, an argument on the command line, and a
folder name\. Any name with non\-url\-safe characters will be rejected\.
Also, it can't start with a dot or an underscore\.
.IP \(bu 2
The name will probably be passed as an argument to require(), so it should
be something short, but also reasonably descriptive\.
.IP \(bu 2
@@ -126,7 +141,7 @@ Or you can shorten that all into a single string, and npm will parse it for you:
.P
.RS 2
.nf
"Barney Rubble <b@rubble\.com> (http://barnyrubble\.tumblr\.com/)
"Barney Rubble <b@rubble\.com> (http://barnyrubble\.tumblr\.com/)"
.fi
.RE
.P
@@ -302,12 +317,18 @@ The URL should be a publicly available (perhaps read\-only) url that can be hand
directly to a VCS program without any modification\. It should not be a url to an
html project page that you put in your browser\. It's for computers\.
.P
For GitHub repositories you can use the same shortcut syntax you use for \fBnpm
install\fR:
For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same
shortcut syntax you use for \fBnpm install\fR:
.P
.RS 2
.nf
"repository": "npm/npm"

"repository": "gist:11081aaa281"

"repository": "bitbucket:example/repo"

"repository": "gitlab:another/repo"
.fi
.RE
.SH scripts
@@ -1,4 +1,4 @@
.TH "NPMRC" "5" "March 2015" "" ""
.TH "NPMRC" "5" "May 2015" "" ""
.SH "NAME"
\fBnpmrc\fR \- The npm config files
.SH DESCRIPTION
@@ -19,7 +19,7 @@ per\-project config file (/path/to/my/project/\.npmrc)
.IP \(bu 2
per\-user config file (~/\.npmrc)
.IP \(bu 2
global config file ($PREFIX/npmrc)
global config file ($PREFIX/etc/npmrc)
.IP \(bu 2
npm builtin config file (/path/to/npm/npmrc)