* npm-prefix(1)
* npm-root(1)
-* npm-folders(7)
+* npm-folders(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
## SEE ALSO
-* npm-folders(7)
+* npm-folders(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
## SEE ALSO
-* npm-folders(7)
+* npm-folders(5)
* npm-explore(1)
* npm-install(1)
* npm-config(1)
## SEE ALSO
* npm-submodule(1)
-* npm-folders(7)
+* npm-folders(5)
* npm-edit(1)
* npm-rebuild(1)
* npm-build(1)
* npm(1)
* README
* npm-faq(7)
-* npm-folders(7)
+* npm-folders(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
npm install <name>@<tag>
npm install <name>@<version>
npm install <name>@<version range>
- npm install <name>@<version range>
## DESCRIPTION
npm install sax --force
The `--global` argument will cause npm to install the package globally
-rather than locally. See `npm-folders(7)`.
+rather than locally. See `npm-folders(5)`.
The `--link` argument will cause npm to link global installs into the
local space in some cases.
That is, the dependency from B to C is satisfied by the fact that A
already caused C to be installed at a higher level.
-See npm-folders(7) for a more detailed description of the specific
+See npm-folders(5) for a more detailed description of the specific
folder structures that npm creates.
### Limitations of npm's Install Algorithm
## SEE ALSO
-* npm-folders(7)
+* npm-folders(5)
* npm-update(1)
* npm-link(1)
* npm-rebuild(1)
* npm-config(7)
* npmrc(5)
* npm-registry(7)
-* npm-folders(7)
+* npm-folders(5)
* npm-tag(1)
* npm-rm(1)
* npm-shrinkwrap(1)
* npm-faq(7)
* package.json(5)
* npm-install(1)
-* npm-folders(7)
+* npm-folders(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
-* npm-folders(7)
+* npm-folders(5)
* npm-install(1)
* npm-link(1)
* npm-prune(1)
* npm-update(1)
* npm-registry(7)
-* npm-folders(7)
+* npm-folders(5)
* npm-root(1)
* npm-bin(1)
-* npm-folders(7)
+* npm-folders(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
## SEE ALSO
* npm-rm(1)
-* npm-folders(7)
-* npm-list(1)
+* npm-folders(5)
+* npm-ls(1)
* npm-prune(1)
* npm-install(1)
-* npm-folders(7)
+* npm-folders(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* npm-prefix(1)
* npm-bin(1)
-* npm-folders(7)
+* npm-folders(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* npm-install(1)
* package.json(5)
-* npm-list(1)
+* npm-ls(1)
* npm-prune(1)
* npm-install(1)
-* npm-folders(7)
+* npm-folders(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* npm-install(1)
* npm-outdated(1)
* npm-registry(7)
-* npm-folders(7)
-* npm-list(1)
+* npm-folders(5)
+* npm-ls(1)
## DIRECTORIES
-See `npm-folders(7)` to learn about where npm puts stuff.
+See `npm-folders(5)` to learn about where npm puts stuff.
In particular, npm has two modes of operation:
Operates in "global" mode, so that packages are installed into the
`prefix` folder instead of the current working directory. See
-`npm-folders(7)` for more on the differences in behavior.
+`npm-folders(5)` for more on the differences in behavior.
* packages are installed into the `{prefix}/lib/node_modules` folder, instead of the
current working directory.
### prefix
-* Default: see npm-folders(7)
+* Default: see npm-folders(5)
* Type: path
The location to install global items. If set on the command line, then
<ul><li><a href="cli/npm.html">npm(1)</a></li><li><a href="cli/npm-faq.html">npm-faq(1)</a></li><li><a href="cli/npm-help.html">npm-help(1)</a></li><li><a href="cli/npm-index.html">npm-index(1)</a></li></ul>
</div>
-<p id="footer"><a href="../doc/README.html">README</a> — npm@1.3.4</p>
+<p id="footer"><a href="../doc/README.html">README</a> — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This function should not be used programmatically. Instead, just refer
to the <code>npm.bin</code> member.</p>
</div>
-<p id="footer">npm-bin — npm@1.3.4</p>
+<p id="footer">npm-bin — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This command will launch a browser, so this command may not be the most
friendly for programmatic use.</p>
</div>
-<p id="footer">npm-bugs — npm@1.3.4</p>
+<p id="footer">npm-bugs — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-index.html">npm-index(7)</a></li></ul>
</div>
-<p id="footer">npm-commands — npm@1.3.4</p>
+<p id="footer">npm-commands — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../api/npm.html">npm(3)</a></li></ul>
</div>
-<p id="footer">npm-config — npm@1.3.4</p>
+<p id="footer">npm-config — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../api/npm-publish.html">npm-publish(3)</a></li><li><a href="../api/npm-unpublish.html">npm-unpublish(3)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li></ul>
</div>
-<p id="footer">npm-deprecate — npm@1.3.4</p>
+<p id="footer">npm-deprecate — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This command will launch a browser, so this command may not be the most
friendly for programmatic use.</p>
</div>
-<p id="footer">npm-docs — npm@1.3.4</p>
+<p id="footer">npm-docs — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Since this command opens an editor in a new process, be careful about where
and how this is used.</p>
</div>
-<p id="footer">npm-edit — npm@1.3.4</p>
+<p id="footer">npm-edit — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>The first element in the 'args' parameter must be a package name. After that is the optional command, which can be any number of strings. All of the strings will be combined into one, space-delimited command.</p>
</div>
-<p id="footer">npm-explore — npm@1.3.4</p>
+<p id="footer">npm-explore — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>The silent parameter is not neccessary not used, but it may in the future.</p>
</div>
-<p id="footer">npm-help-search — npm@1.3.4</p>
+<p id="footer">npm-help-search — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p><a href="../files/package.json.html">package.json(5)</a></p>
</div>
-<p id="footer">npm-init — npm@1.3.4</p>
+<p id="footer">npm-init — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Finally, 'callback' is a function that will be called when all packages have been
installed or when an error has been encountered.</p>
</div>
-<p id="footer">npm-install — npm@1.3.4</p>
+<p id="footer">npm-install — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Now, any changes to the redis package will be reflected in
the package in the current working directory</p>
</div>
-<p id="footer">npm-link — npm@1.3.4</p>
+<p id="footer">npm-link — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>For a list of all the available command-line configs, see <code>npm help config</code></p>
</div>
-<p id="footer">npm-load — npm@1.3.4</p>
+<p id="footer">npm-load — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
This means that if a submodule a same dependency as a parent module, then the
dependency will only be output once.</p>
</div>
-<p id="footer">npm-ls — npm@1.3.4</p>
+<p id="footer">npm-ls — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>If the 'packages' parameter is left out, npm will check all packages.</p>
</div>
-<p id="footer">npm-outdated — npm@1.3.4</p>
+<p id="footer">npm-outdated — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../api/npm-publish.html">npm-publish(3)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li></ul>
</div>
-<p id="footer">npm-owner — npm@1.3.4</p>
+<p id="footer">npm-owner — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>If no arguments are supplied, then npm packs the current package folder.</p>
</div>
-<p id="footer">npm-pack — npm@1.3.4</p>
+<p id="footer">npm-pack — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This function is not useful programmatically</p>
</div>
-<p id="footer">npm-prefix — npm@1.3.4</p>
+<p id="footer">npm-prefix — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Extraneous packages are packages that are not listed on the parent
package's dependencies list.</p>
</div>
-<p id="footer">npm-prune — npm@1.3.4</p>
+<p id="footer">npm-prune — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li><li><a href="../api/npm-owner.html">npm-owner(3)</a></li></ul>
</div>
-<p id="footer">npm-publish — npm@1.3.4</p>
+<p id="footer">npm-publish — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>See <code>npm help build</code></p>
</div>
-<p id="footer">npm-rebuild — npm@1.3.4</p>
+<p id="footer">npm-rebuild — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../api/npm-start.html">npm-start(3)</a></li><li><a href="../api/npm-stop.html">npm-stop(3)</a></li></ul>
</div>
-<p id="footer">npm-restart — npm@1.3.4</p>
+<p id="footer">npm-restart — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This function is not useful programmatically.</p>
</div>
-<p id="footer">npm-root — npm@1.3.4</p>
+<p id="footer">npm-root — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../api/npm-test.html">npm-test(3)</a></li><li><a href="../api/npm-start.html">npm-start(3)</a></li><li><a href="../api/npm-restart.html">npm-restart(3)</a></li><li><a href="../api/npm-stop.html">npm-stop(3)</a></li></ul>
</div>
-<p id="footer">npm-run-script — npm@1.3.4</p>
+<p id="footer">npm-run-script — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
and doesn't try to read your mind (it doesn't do any verb tense matching or the
like).</p>
</div>
-<p id="footer">npm-search — npm@1.3.4</p>
+<p id="footer">npm-search — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Finally, 'callback' is a function that will be called when the shrinkwrap has
been saved.</p>
</div>
-<p id="footer">npm-shrinkwrap — npm@1.3.4</p>
+<p id="footer">npm-shrinkwrap — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>npm can run tests on multiple packages. Just specify multiple packages
in the <code>packages</code> parameter.</p>
</div>
-<p id="footer">npm-start — npm@1.3.4</p>
+<p id="footer">npm-start — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>npm can run stop on multiple packages. Just specify multiple packages
in the <code>packages</code> parameter.</p>
</div>
-<p id="footer">npm-stop — npm@1.3.4</p>
+<p id="footer">npm-stop — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li>npm help json</li><li>git help submodule</li></ul>
</div>
-<p id="footer">npm-submodule — npm@1.3.4</p>
+<p id="footer">npm-submodule — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
used. For more information about how to set this config, check
<code>man 3 npm-config</code> for programmatic usage or <code>man npm-config</code> for cli usage.</p>
</div>
-<p id="footer">npm-tag — npm@1.3.4</p>
+<p id="footer">npm-tag — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>npm can run tests on multiple packages. Just specify multiple packages
in the <code>packages</code> parameter.</p>
</div>
-<p id="footer">npm-test — npm@1.3.4</p>
+<p id="footer">npm-test — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Finally, 'callback' is a function that will be called when all packages have been
uninstalled or when an error has been encountered.</p>
</div>
-<p id="footer">npm-uninstall — npm@1.3.4</p>
+<p id="footer">npm-uninstall — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>If no version is specified, or if all versions are removed then
the root package entry is removed from the registry entirely.</p>
</div>
-<p id="footer">npm-unpublish — npm@1.3.4</p>
+<p id="footer">npm-unpublish — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>The 'packages' argument is an array of packages to update. The 'callback' parameter will be called when done or when an error occurs.</p>
</div>
-<p id="footer">npm-update — npm@1.3.4</p>
+<p id="footer">npm-update — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
parameter. The difference, however, is this function will fail if it does
not have exactly one element. The only element should be a version number.</p>
</div>
-<p id="footer">npm-version — npm@1.3.4</p>
+<p id="footer">npm-version — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>corresponding to the list of fields selected.</p>
</div>
-<p id="footer">npm-view — npm@1.3.4</p>
+<p id="footer">npm-view — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>This function is not useful programmatically</p>
</div>
-<p id="footer">npm-whoami — npm@1.3.4</p>
+<p id="footer">npm-whoami — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="VERSION">VERSION</h2>
-<p>1.3.4</p>
+<p>1.3.5</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<pre><code>var cmd = npm.deref("unp") // cmd === "unpublish"</code></pre>
</div>
-<p id="footer">npm — npm@1.3.4</p>
+<p id="footer">npm — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../cli/npm-owner.html">npm-owner(1)</a></li><li><a href="../cli/npm-whoami.html">npm-whoami(1)</a></li></ul>
</div>
-<p id="footer">npm-adduser — npm@1.3.4</p>
+<p id="footer">npm-adduser — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<ul><li><a href="../cli/npm-prefix.html">npm-prefix(1)</a></li><li><a href="../cli/npm-root.html">npm-root(1)</a></li><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
+<ul><li><a href="../cli/npm-prefix.html">npm-prefix(1)</a></li><li><a href="../cli/npm-root.html">npm-root(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-bin — npm@1.3.4</p>
+<p id="footer">npm-bin — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-docs.html">npm-docs(1)</a></li><li><a href="../cli/npm-view.html">npm-view(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li></ul>
</div>
-<p id="footer">npm-bugs — npm@1.3.4</p>
+<p id="footer">npm-bugs — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<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><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li></ul>
</div>
-<p id="footer">npm-build — npm@1.3.4</p>
+<p id="footer">npm-build — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
</div>
-<p id="footer">npm-bundle — npm@1.3.4</p>
+<p id="footer">npm-bundle — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<ul><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../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-pack.html">npm-pack(1)</a></li></ul>
+<ul><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../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-pack.html">npm-pack(1)</a></li></ul>
</div>
-<p id="footer">npm-cache — npm@1.3.4</p>
+<p id="footer">npm-cache — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">npm-completion — npm@1.3.4</p>
+<p id="footer">npm-completion — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">npm-config — npm@1.3.4</p>
+<p id="footer">npm-config — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-ls.html">npm-ls(1)</a></li><li><a href="../cli/npm-update.html">npm-update(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
</div>
-<p id="footer">npm-dedupe — npm@1.3.4</p>
+<p id="footer">npm-dedupe — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li></ul>
</div>
-<p id="footer">npm-deprecate — npm@1.3.4</p>
+<p id="footer">npm-deprecate — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-view.html">npm-view(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li></ul>
</div>
-<p id="footer">npm-docs — npm@1.3.4</p>
+<p id="footer">npm-docs — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<ul><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li><li><a href="../cli/npm-explore.html">npm-explore(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
+<ul><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-explore.html">npm-explore(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-edit — npm@1.3.4</p>
+<p id="footer">npm-edit — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<ul><li><a href="../cli/npm-submodule.html">npm-submodule(1)</a></li><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li><li><a href="../cli/npm-edit.html">npm-edit(1)</a></li><li><a href="../cli/npm-rebuild.html">npm-rebuild(1)</a></li><li><a href="../cli/npm-build.html">npm-build(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
+<ul><li><a href="../cli/npm-submodule.html">npm-submodule(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-edit.html">npm-edit(1)</a></li><li><a href="../cli/npm-rebuild.html">npm-rebuild(1)</a></li><li><a href="../cli/npm-build.html">npm-build(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
</div>
-<p id="footer">npm-explore — npm@1.3.4</p>
+<p id="footer">npm-explore — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm.html">npm(1)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm-help.html">npm-help(1)</a></li></ul>
</div>
-<p id="footer">npm-help-search — npm@1.3.4</p>
+<p id="footer">npm-help-search — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<ul><li><a href="../cli/npm.html">npm(1)</a></li><li><a href="../../doc/README.html">README</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-help-search.html">npm-help-search(1)</a></li><li><a href="../misc/npm-index.html">npm-index(7)</a></li></ul>
+<ul><li><a href="../cli/npm.html">npm(1)</a></li><li><a href="../../doc/README.html">README</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-help-search.html">npm-help-search(1)</a></li><li><a href="../misc/npm-index.html">npm-index(7)</a></li></ul>
</div>
-<p id="footer">npm-help — npm@1.3.4</p>
+<p id="footer">npm-help — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="https://github.com/isaacs/init-package-json">https://github.com/isaacs/init-package-json</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-version.html">npm-version(1)</a></li></ul>
</div>
-<p id="footer">npm-init — npm@1.3.4</p>
+<p id="footer">npm-init — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
npm install <name> [--save|--save-dev|--save-optional]
npm install <name>@<tag>
npm install <name>@<version>
-npm install <name>@<version range>
npm install <name>@<version range></code></pre>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<pre><code>npm install sax --force</code></pre>
<p>The <code>--global</code> argument will cause npm to install the package globally
-rather than locally. See <code><a href="../misc/npm-folders.html">npm-folders(7)</a></code>.</p>
+rather than locally. See <code><a href="../files/npm-folders.html">npm-folders(5)</a></code>.</p>
<p>The <code>--link</code> argument will cause npm to link global installs into the
local space in some cases.</p>
<p>That is, the dependency from B to C is satisfied by the fact that A
already caused C to be installed at a higher level.</p>
-<p>See <a href="../misc/npm-folders.html">npm-folders(7)</a> for a more detailed description of the specific
+<p>See <a href="../files/npm-folders.html">npm-folders(5)</a> for a more detailed description of the specific
folder structures that npm creates.</p>
<h3 id="Limitations-of-npm-s-Install-Algorithm">Limitations of npm's Install Algorithm</h3>
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<ul><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li><li><a href="../cli/npm-update.html">npm-update(1)</a></li><li><a href="../cli/npm-link.html">npm-link(1)</a></li><li><a href="../cli/npm-rebuild.html">npm-rebuild(1)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-build.html">npm-build(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li><li><a href="../cli/npm-tag.html">npm-tag(1)</a></li><li><a href="../cli/npm-rm.html">npm-rm(1)</a></li><li><a href="../cli/npm-shrinkwrap.html">npm-shrinkwrap(1)</a></li></ul>
+<ul><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-update.html">npm-update(1)</a></li><li><a href="../cli/npm-link.html">npm-link(1)</a></li><li><a href="../cli/npm-rebuild.html">npm-rebuild(1)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-build.html">npm-build(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-tag.html">npm-tag(1)</a></li><li><a href="../cli/npm-rm.html">npm-rm(1)</a></li><li><a href="../cli/npm-shrinkwrap.html">npm-shrinkwrap(1)</a></li></ul>
</div>
-<p id="footer">npm-install — npm@1.3.4</p>
+<p id="footer">npm-install — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<ul><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
+<ul><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-link — npm@1.3.4</p>
+<p id="footer">npm-link — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
nested packages will <em>also</em> show the paths to the specified packages.
For example, running <code>npm ls promzard</code> in npm's source tree will show:</p>
-<pre><code>npm@1.3.4 /path/to/npm
+<pre><code>npm@1.3.5 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5</code></pre>
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<ul><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-link.html">npm-link(1)</a></li><li><a href="../cli/npm-prune.html">npm-prune(1)</a></li><li><a href="../cli/npm-outdated.html">npm-outdated(1)</a></li><li><a href="../cli/npm-update.html">npm-update(1)</a></li></ul>
+<ul><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-link.html">npm-link(1)</a></li><li><a href="../cli/npm-prune.html">npm-prune(1)</a></li><li><a href="../cli/npm-outdated.html">npm-outdated(1)</a></li><li><a href="../cli/npm-update.html">npm-update(1)</a></li></ul>
</div>
-<p id="footer">npm-ls — npm@1.3.4</p>
+<p id="footer">npm-ls — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<ul><li><a href="../cli/npm-update.html">npm-update(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li></ul>
+<ul><li><a href="../cli/npm-update.html">npm-update(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li></ul>
</div>
-<p id="footer">npm-outdated — npm@1.3.4</p>
+<p id="footer">npm-outdated — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li><li><a href="../misc/npm-disputes.html">npm-disputes(7)</a></li></ul>
</div>
-<p id="footer">npm-owner — npm@1.3.4</p>
+<p id="footer">npm-owner — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-cache.html">npm-cache(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-pack — npm@1.3.4</p>
+<p id="footer">npm-pack — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<ul><li><a href="../cli/npm-root.html">npm-root(1)</a></li><li><a href="../cli/npm-bin.html">npm-bin(1)</a></li><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
+<ul><li><a href="../cli/npm-root.html">npm-root(1)</a></li><li><a href="../cli/npm-bin.html">npm-bin(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-prefix — npm@1.3.4</p>
+<p id="footer">npm-prefix — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<ul><li><a href="../cli/npm-rm.html">npm-rm(1)</a></li><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li><li><a href="../cli/npm-list.html">npm-list(1)</a></li></ul>
+<ul><li><a href="../cli/npm-rm.html">npm-rm(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-ls.html">npm-ls(1)</a></li></ul>
</div>
-<p id="footer">npm-prune — npm@1.3.4</p>
+<p id="footer">npm-prune — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li><li><a href="../cli/npm-owner.html">npm-owner(1)</a></li><li><a href="../cli/npm-deprecate.html">npm-deprecate(1)</a></li><li><a href="../cli/npm-tag.html">npm-tag(1)</a></li></ul>
</div>
-<p id="footer">npm-publish — npm@1.3.4</p>
+<p id="footer">npm-publish — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-build.html">npm-build(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
</div>
-<p id="footer">npm-rebuild — npm@1.3.4</p>
+<p id="footer">npm-rebuild — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-run-script.html">npm-run-script(1)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-test.html">npm-test(1)</a></li><li><a href="../cli/npm-start.html">npm-start(1)</a></li><li><a href="../cli/npm-stop.html">npm-stop(1)</a></li></ul>
</div>
-<p id="footer">npm-restart — npm@1.3.4</p>
+<p id="footer">npm-restart — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<ul><li><a href="../cli/npm-prune.html">npm-prune(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
+<ul><li><a href="../cli/npm-prune.html">npm-prune(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-rm — npm@1.3.4</p>
+<p id="footer">npm-rm — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<ul><li><a href="../cli/npm-prefix.html">npm-prefix(1)</a></li><li><a href="../cli/npm-bin.html">npm-bin(1)</a></li><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
+<ul><li><a href="../cli/npm-prefix.html">npm-prefix(1)</a></li><li><a href="../cli/npm-bin.html">npm-bin(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-root — npm@1.3.4</p>
+<p id="footer">npm-root — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-test.html">npm-test(1)</a></li><li><a href="../cli/npm-start.html">npm-start(1)</a></li><li><a href="../cli/npm-restart.html">npm-restart(1)</a></li><li><a href="../cli/npm-stop.html">npm-stop(1)</a></li></ul>
</div>
-<p id="footer">npm-run-script — npm@1.3.4</p>
+<p id="footer">npm-run-script — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../cli/npm-view.html">npm-view(1)</a></li></ul>
</div>
-<p id="footer">npm-search — npm@1.3.4</p>
+<p id="footer">npm-search — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<ul><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-list.html">npm-list(1)</a></li></ul>
+<ul><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-ls.html">npm-ls(1)</a></li></ul>
</div>
-<p id="footer">npm-shrinkwrap — npm@1.3.4</p>
+<p id="footer">npm-shrinkwrap — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-view.html">npm-view(1)</a></li><li><a href="../cli/npm-whoami.html">npm-whoami(1)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li></ul>
</div>
-<p id="footer">npm-star — npm@1.3.4</p>
+<p id="footer">npm-star — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-star.html">npm-star(1)</a></li><li><a href="../cli/npm-view.html">npm-view(1)</a></li><li><a href="../cli/npm-whoami.html">npm-whoami(1)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li></ul>
</div>
-<p id="footer">npm-stars — npm@1.3.4</p>
+<p id="footer">npm-stars — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-run-script.html">npm-run-script(1)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-test.html">npm-test(1)</a></li><li><a href="../cli/npm-restart.html">npm-restart(1)</a></li><li><a href="../cli/npm-stop.html">npm-stop(1)</a></li></ul>
</div>
-<p id="footer">npm-start — npm@1.3.4</p>
+<p id="footer">npm-start — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-run-script.html">npm-run-script(1)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-test.html">npm-test(1)</a></li><li><a href="../cli/npm-start.html">npm-start(1)</a></li><li><a href="../cli/npm-restart.html">npm-restart(1)</a></li></ul>
</div>
-<p id="footer">npm-stop — npm@1.3.4</p>
+<p id="footer">npm-stop — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../files/package.json.html">package.json(5)</a></li><li>git help submodule</li></ul>
</div>
-<p id="footer">npm-submodule — npm@1.3.4</p>
+<p id="footer">npm-submodule — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-tag — npm@1.3.4</p>
+<p id="footer">npm-tag — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-run-script.html">npm-run-script(1)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-start.html">npm-start(1)</a></li><li><a href="../cli/npm-restart.html">npm-restart(1)</a></li><li><a href="../cli/npm-stop.html">npm-stop(1)</a></li></ul>
</div>
-<p id="footer">npm-test — npm@1.3.4</p>
+<p id="footer">npm-test — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="SEE-ALSO">SEE ALSO</h2>
-<ul><li><a href="../cli/npm-prune.html">npm-prune(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
+<ul><li><a href="../cli/npm-prune.html">npm-prune(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
-<p id="footer">npm-uninstall — npm@1.3.4</p>
+<p id="footer">npm-uninstall — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-deprecate.html">npm-deprecate(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li><li><a href="../cli/npm-owner.html">npm-owner(1)</a></li></ul>
</div>
-<p id="footer">npm-unpublish — npm@1.3.4</p>
+<p id="footer">npm-unpublish — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<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-outdated.html">npm-outdated(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../misc/npm-folders.html">npm-folders(7)</a></li><li><a href="../cli/npm-list.html">npm-list(1)</a></li></ul>
+<ul><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-outdated.html">npm-outdated(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-ls.html">npm-ls(1)</a></li></ul>
</div>
-<p id="footer">npm-update — npm@1.3.4</p>
+<p id="footer">npm-update — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-init.html">npm-init(1)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../misc/npm-semver.html">npm-semver(7)</a></li></ul>
</div>
-<p id="footer">npm-version — npm@1.3.4</p>
+<p id="footer">npm-version — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-search.html">npm-search(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../cli/npm-docs.html">npm-docs(1)</a></li></ul>
</div>
-<p id="footer">npm-view — npm@1.3.4</p>
+<p id="footer">npm-view — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li></ul>
</div>
-<p id="footer">npm-whoami — npm@1.3.4</p>
+<p id="footer">npm-whoami — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<h2 id="VERSION">VERSION</h2>
-<p>1.3.4</p>
+<p>1.3.5</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<h2 id="DIRECTORIES">DIRECTORIES</h2>
-<p>See <code><a href="../misc/npm-folders.html">npm-folders(7)</a></code> to learn about where npm puts stuff.</p>
+<p>See <code><a href="../files/npm-folders.html">npm-folders(5)</a></code> to learn about where npm puts stuff.</p>
<p>In particular, npm has two modes of operation:</p>
<ul><li><a href="../cli/npm-help.html">npm-help(1)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../../doc/README.html">README</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-index.html">npm-index(7)</a></li><li><a href="../api/npm.html">npm(3)</a></li></ul>
</div>
-<p id="footer">npm — npm@1.3.4</p>
+<p id="footer">npm — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-pack.html">npm-pack(1)</a></li><li><a href="../cli/npm-cache.html">npm-cache(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li></ul>
</div>
-<p id="footer">npm-folders — npm@1.3.4</p>
+<p id="footer">npm-folders — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-pack.html">npm-pack(1)</a></li><li><a href="../cli/npm-cache.html">npm-cache(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li></ul>
</div>
-<p id="footer">npm-folders — npm@1.3.4</p>
+<p id="footer">npm-folders — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-semver.html">npm-semver(7)</a></li><li><a href="../cli/npm-init.html">npm-init(1)</a></li><li><a href="../cli/npm-version.html">npm-version(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../cli/npm-help.html">npm-help(1)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><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-rm.html">npm-rm(1)</a></li></ul>
</div>
-<p id="footer">package.json — npm@1.3.4</p>
+<p id="footer">package.json — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">npmrc — npm@1.3.4</p>
+<p id="footer">npmrc — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-semver.html">npm-semver(7)</a></li><li><a href="../cli/npm-init.html">npm-init(1)</a></li><li><a href="../cli/npm-version.html">npm-version(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../cli/npm-help.html">npm-help(1)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><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-rm.html">npm-rm(1)</a></li></ul>
</div>
-<p id="footer">package.json — npm@1.3.4</p>
+<p id="footer">package.json — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>The semantic versioner for npm</p>
</div>
-<p id="footer">npm-index — npm@1.3.4</p>
+<p id="footer">npm-index — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">npm-coding-style — npm@1.3.4</p>
+<p id="footer">npm-coding-style — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>Operates in "global" mode, so that packages are installed into the
<code>prefix</code> folder instead of the current working directory. See
-<code><a href="../misc/npm-folders.html">npm-folders(7)</a></code> for more on the differences in behavior.</p>
+<code><a href="../files/npm-folders.html">npm-folders(5)</a></code> for more on the differences in behavior.</p>
<ul><li>packages are installed into the <code>{prefix}/lib/node_modules</code> folder, instead of the
current working directory.</li><li>bin files are linked to <code>{prefix}/bin</code></li><li>man pages are linked to <code>{prefix}/share/man</code></li></ul>
<h3 id="prefix">prefix</h3>
-<ul><li>Default: see <a href="../misc/npm-folders.html">npm-folders(7)</a></li><li>Type: path</li></ul>
+<ul><li>Default: see <a href="../files/npm-folders.html">npm-folders(5)</a></li><li>Type: path</li></ul>
<p>The location to install global items. If set on the command line, then
it forces non-global commands to run in the specified folder.</p>
<ul><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">npm-config — npm@1.3.4</p>
+<p id="footer">npm-config — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm.html">npm(1)</a></li><li><a href="../cli/npm-init.html">npm-init(1)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li></ul>
</div>
-<p id="footer">npm-developers — npm@1.3.4</p>
+<p id="footer">npm-developers — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-owner.html">npm-owner(1)</a></li></ul>
</div>
-<p id="footer">npm-disputes — npm@1.3.4</p>
+<p id="footer">npm-disputes — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm.html">npm(1)</a></li><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li></ul>
</div>
-<p id="footer">npm-faq — npm@1.3.4</p>
+<p id="footer">npm-faq — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<p>The semantic versioner for npm</p>
</div>
-<p id="footer">npm-index — npm@1.3.4</p>
+<p id="footer">npm-index — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../misc/npm-disputes.html">npm-disputes(7)</a></li></ul>
</div>
-<p id="footer">npm-registry — npm@1.3.4</p>
+<p id="footer">npm-registry — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../cli/npm-run-script.html">npm-run-script(1)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
</div>
-<p id="footer">npm-scripts — npm@1.3.4</p>
+<p id="footer">npm-scripts — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
<ul><li><a href="../../doc/README.html">README</a></li><li><a href="../cli/npm-rm.html">npm-rm(1)</a></li><li><a href="../cli/npm-prune.html">npm-prune(1)</a></li></ul>
</div>
-<p id="footer">removing-npm — npm@1.3.4</p>
+<p id="footer">removing-npm — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
range.</li><li>maxSatisfying(versions, range): Return the highest version in the list
that satisfies the range, or null if none of them do.</li></ul>
</div>
-<p id="footer">semver — npm@1.3.4</p>
+<p id="footer">semver — npm@1.3.5</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
function addNameVersion (name, v, data, cb) {
if (typeof cb !== "function") cb = data, data = null
- ver = semver.valid(v, true)
+ var ver = semver.valid(v, true)
if (!ver) return cb(new Error("Invalid version: "+v))
var response
// 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, true, function (er, data) {
+ readJson(jsonFile, log.warn, function (er, data) {
if (er
&& er.code !== "ENOENT"
&& er.code !== "ENOTDIR") return cb(er)
var wrap = context ? context.wrap : null
readJson( path.resolve(where, "package.json")
+ , log.warn
, function (er, data) {
if (er) return cb(er)
if (context.explicit) return next()
- readJson(path.join(where, "package.json"), true, function (er, data) {
+ readJson(path.join(where, "package.json"), log.warn, function (er, data) {
if (er) return next(er)
lifecycle(data, "preinstall", where, next)
})
asyncMap(pkgs.map(function (p) {
return path.resolve(nm, p, "package.json")
}), function (jsonfile, cb) {
- readJson(jsonfile, function (er, data) {
+ readJson(jsonfile, log.warn, function (er, data) {
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
if (er) return cb(null, [])
return cb(null, [[data.name, data.version]])
})
asyncMap(inst, function (pkg, cb) {
- readJson(path.resolve(nm, pkg, "package.json"), function (er, d) {
+ readJson(path.resolve(nm, pkg, "package.json"), 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, [])
, "package.json" )
, parent = context.parent
- readJson(jsonFile, function (er, data) {
+ readJson(jsonFile, log.warn, function (er, data) {
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
if (er || data._id === target._id) {
if (er) {
npm install <name>@<tag>
npm install <name>@<version>
npm install <name>@<version range>
-npm install <name>@<version range>
.
.fi
.
.IP "" 4
.
.nf
-npm@1.3.4 /path/to/npm
+npm@1.3.5 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.
npm help folders
.
.IP "\(bu" 4
-npm help list
+npm help ls
.
.IP "" 0
npm help package\.json
.
.IP "\(bu" 4
-npm help list
+npm help ls
.
.IP "" 0
npm help folders
.
.IP "\(bu" 4
-npm help list
+npm help ls
.
.IP "" 0
.fi
.
.SH "VERSION"
-1.3.4
+1.3.5
.
.SH "DESCRIPTION"
npm is the package manager for the Node JavaScript platform\. It puts
.fi
.
.SH "VERSION"
-1.3.4
+1.3.5
.
.SH "DESCRIPTION"
This is the API documentation for npm\.
},
"name": "block-stream",
"description": "a stream of blocks",
- "version": "0.0.6",
+ "version": "0.0.7",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/block-stream.git"
},
"main": "block-stream.js",
"dependencies": {
- "inherits": "~1.0.0"
+ "inherits": "~2.0.0"
},
"devDependencies": {
"tap": "0.x"
},
"license": "BSD",
"readme": "# block-stream\n\nA stream of blocks.\n\nWrite data into it, and it'll output data in buffer blocks the size you\nspecify, padding with zeroes if necessary.\n\n```javascript\nvar block = new BlockStream(512)\nfs.createReadStream(\"some-file\").pipe(block)\nblock.pipe(fs.createWriteStream(\"block-file\"))\n```\n\nWhen `.end()` or `.flush()` is called, it'll pad the block with zeroes.\n",
- "_id": "block-stream@0.0.6",
- "_from": "block-stream@*"
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/isaacs/block-stream/issues"
+ },
+ "_id": "block-stream@0.0.7",
+ "_from": "block-stream@latest"
}
-lib-cov\r
-*.seed\r
-*.log\r
-*.csv\r
-*.dat\r
-*.out\r
-*.pid\r
-*.gz\r
-\r
-pids\r
-logs\r
-results\r
-\r
-npm-debug.log\r
-\r
-node_modules\r
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+
+pids
+logs
+results
+
+npm-debug.log
+
+node_modules
+++ /dev/null
-language: node_js\r
-node_js:\r
- - "0.10"\r
- - "0.8"
\ No newline at end of file
-Copyright (c) Isaac Z. Schlueter ("Author")\r
-All rights reserved.\r
-\r
-The BSD License\r
-\r
-Redistribution and use in source and binary forms, with or without\r
-modification, are permitted provided that the following conditions\r
-are met:\r
-\r
-1. Redistributions of source code must retain the above copyright\r
- notice, this list of conditions and the following disclaimer.\r
-\r
-2. Redistributions in binary form must reproduce the above copyright\r
- notice, this list of conditions and the following disclaimer in the\r
- documentation and/or other materials provided with the distribution.\r
-\r
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\r
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS\r
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\r
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\r
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\r
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+Copyright (c) Isaac Z. Schlueter ("Author")
+All rights reserved.
+
+The BSD License
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-# cmd-shim\r
-\r
-The cmd-shim used in npm to create executable scripts on Windows,\r
-since symlinks are not suitable for this purpose there.\r
-\r
-On Unix systems, you should use a symbolic link instead.\r
-\r
-[![Build Status](https://travis-ci.org/ForbesLindesay/cmd-shim.png?branch=master)](https://travis-ci.org/ForbesLindesay/cmd-shim) [![Dependency Status](https://gemnasium.com/ForbesLindesay/cmd-shim.png)](https://gemnasium.com/ForbesLindesay/cmd-shim)\r
-\r
-## Installation\r
-\r
-```\r
-npm install cmd-shim\r
-```\r
-\r
-## API\r
-\r
-### cmdShim(from, to, cb)\r
-\r
-Create a cmd shim at `to` for the command line program at `from`.\r
-e.g.\r
-\r
-```javascript\r
-var cmdShim = require('cmd-shim');\r
-cmdShim(__dirname + '/cli.js', '/usr/bin/command-name', function (err) {\r
- if (err) throw err;\r
-});\r
-```\r
-\r
-### cmdShim.ifExists(from, to, cb)\r
-\r
-The same as above, but will just continue if the file does not exist.\r
-Source:\r
-\r
-```javascript\r
-function cmdShimIfExists (from, to, cb) {\r
- fs.stat(from, function (er) {\r
- if (er) return cb()\r
- cmdShim(from, to, cb)\r
- })\r
-}\r
-```\r
+# cmd-shim
+
+The cmd-shim used in npm to create executable scripts on Windows,
+since symlinks are not suitable for this purpose there.
+
+On Unix systems, you should use a symbolic link instead.
+
+## Installation
+
+```
+npm install cmd-shim
+```
+
+## API
+
+### cmdShim(from, to, cb)
+
+Create a cmd shim at `to` for the command line program at `from`.
+e.g.
+
+```javascript
+var cmdShim = require('cmd-shim');
+cmdShim(__dirname + '/cli.js', '/usr/bin/command-name', function (err) {
+ if (err) throw err;
+});
+```
+
+### cmdShim.ifExists(from, to, cb)
+
+The same as above, but will just continue if the file does not exist.
+Source:
+
+```javascript
+function cmdShimIfExists (from, to, cb) {
+ fs.stat(from, function (er) {
+ if (er) return cb()
+ cmdShim(from, to, cb)
+ })
+}
+```
-// On windows, create a .cmd file.\r
-// Read the #! in the file to see what it uses. The vast majority\r
-// of the time, this will be either:\r
-// "#!/usr/bin/env <prog> <args...>"\r
-// or:\r
-// "#!<prog> <args...>"\r
-//\r
-// Write a binroot/pkg.bin + ".cmd" file that has this line in it:\r
-// @<prog> <args...> %~dp0<target> %*\r
-\r
-module.exports = cmdShim\r
-cmdShim.ifExists = cmdShimIfExists\r
-\r
-try {\r
- var fs = require("graceful-fs")\r
-} catch (e) {\r
- var fs = require("fs")\r
-}\r
-\r
-var mkdir = require("mkdirp")\r
- , path = require("path")\r
- , shebangExpr = /^#\!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+)(.*)$/\r
-\r
-function cmdShimIfExists (from, to, cb) {\r
- fs.stat(from, function (er) {\r
- if (er) return cb()\r
- cmdShim(from, to, cb)\r
- })\r
-}\r
-\r
-// Try to unlink, but ignore errors.\r
-// Any problems will surface later.\r
-function rm (path, cb) {\r
- fs.unlink(path, function(er) {\r
- cb()\r
- })\r
-}\r
-\r
-function cmdShim (from, to, cb) {\r
- fs.stat(from, function (er, stat) {\r
- if (er)\r
- return cb(er)\r
-\r
- cmdShim_(from, to, cb)\r
- })\r
-}\r
-\r
-function cmdShim_ (from, to, cb) {\r
- var then = times(2, next, cb)\r
- rm(to, then)\r
- rm(to + ".cmd", then)\r
-\r
- function next(er) {\r
- writeShim(from, to, cb)\r
- }\r
-}\r
-\r
-function writeShim (from, to, cb) {\r
- // make a cmd file and a sh script\r
- // First, check if the bin is a #! of some sort.\r
- // If not, then assume it's something that'll be compiled, or some other\r
- // sort of script, and just call it directly.\r
- mkdir(path.dirname(to), function (er) {\r
- if (er)\r
- return cb(er)\r
- fs.readFile(from, "utf8", function (er, data) {\r
- if (er) return writeShim_(from, to, null, null, cb)\r
- var firstLine = data.trim().split(/\r*\n/)[0]\r
- , shebang = firstLine.match(shebangExpr)\r
- if (!shebang) return writeShim_(from, to, null, null, cb)\r
- var prog = shebang[1]\r
- , args = shebang[2] || ""\r
- return writeShim_(from, to, prog, args, cb)\r
- })\r
- })\r
-}\r
-\r
-function writeShim_ (from, to, prog, args, cb) {\r
- var shTarget = path.relative(path.dirname(to), from)\r
- , target = shTarget.split("/").join("\\")\r
- , longProg\r
- , shProg = prog && prog.split("\\").join("/")\r
- , shLongProg\r
- shTarget = shTarget.split("\\").join("/")\r
- args = args || ""\r
- if (!prog) {\r
- prog = "\"%~dp0\\" + target + "\""\r
- shProg = "\"$basedir/" + shTarget + "\""\r
- args = ""\r
- target = ""\r
- shTarget = ""\r
- } else {\r
- longProg = "\"%~dp0\\" + prog + ".exe\""\r
- shLongProg = "\"$basedir/" + prog + "\""\r
- target = "\"%~dp0\\" + target + "\""\r
- shTarget = "\"$basedir/" + shTarget + "\""\r
- }\r
-\r
- // @IF EXIST "%~dp0\node.exe" (\r
- // "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*\r
- // ) ELSE (\r
- // node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*\r
- // )\r
- var cmd\r
- if (longProg) {\r
- cmd = "@IF EXIST " + longProg + " (\r\n"\r
- + " " + longProg + " " + args + " " + target + " %*\r\n"\r
- + ") ELSE (\r\n"\r
- + " " + prog + " " + args + " " + target + " %*\r\n"\r
- + ")"\r
- } else {\r
- cmd = prog + " " + args + " " + target + " %*\r\n"\r
- }\r
-\r
- // #!/bin/sh\r
- // basedir=`dirname "$0"`\r
- //\r
- // case `uname` in\r
- // *CYGWIN*) basedir=`cygpath -w "$basedir"`;;\r
- // esac\r
- //\r
- // if [ -x "$basedir/node.exe" ]; then\r
- // "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@"\r
- // ret=$?\r
- // else\r
- // node "$basedir/node_modules/npm/bin/npm-cli.js" "$@"\r
- // ret=$?\r
- // fi\r
- // exit $ret\r
-\r
- var sh = "#!/bin/sh\n"\r
-\r
- if (shLongProg) {\r
- sh = sh\r
- + "basedir=`dirname \"$0\"`\n"\r
- + "\n"\r
- + "case `uname` in\n"\r
- + " *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;\n"\r
- + "esac\n"\r
- + "\n"\r
-\r
- sh = sh\r
- + "if [ -x "+shLongProg+" ]; then\n"\r
- + " " + shLongProg + " " + args + " " + shTarget + " \"$@\"\n"\r
- + " ret=$?\n"\r
- + "else \n"\r
- + " " + shProg + " " + args + " " + shTarget + " \"$@\"\n"\r
- + " ret=$?\n"\r
- + "fi\n"\r
- + "exit $ret\n"\r
- } else {\r
- sh = shProg + " " + args + " " + shTarget + " \"$@\"\n"\r
- + "exit $?\n"\r
- }\r
-\r
- var then = times(2, next, cb)\r
- fs.writeFile(to + ".cmd", cmd, "utf8", then)\r
- fs.writeFile(to, sh, "utf8", then)\r
- function next () {\r
- chmodShim(to, cb)\r
- }\r
-}\r
-\r
-function chmodShim (to, cb) {\r
- var then = times(2, cb, cb)\r
- fs.chmod(to, 0755, then)\r
- fs.chmod(to + ".cmd", 0755, then)\r
-}\r
-\r
-function times(n, ok, cb) {\r
- var errState = null\r
- return function(er) {\r
- if (!errState) {\r
- if (er)\r
- cb(errState = er)\r
- else if (--n === 0)\r
- ok()\r
- }\r
- }\r
-}\r
+// On windows, create a .cmd file.
+// Read the #! in the file to see what it uses. The vast majority
+// of the time, this will be either:
+// "#!/usr/bin/env <prog> <args...>"
+// or:
+// "#!<prog> <args...>"
+//
+// Write a binroot/pkg.bin + ".cmd" file that has this line in it:
+// @<prog> <args...> %~dp0<target> %*
+
+module.exports = cmdShim
+cmdShim.ifExists = cmdShimIfExists
+
+try {
+ var fs = require("graceful-fs")
+} catch (e) {
+ var fs = require("fs")
+}
+
+var mkdir = require("mkdirp")
+ , path = require("path")
+ , shebangExpr = /^#\!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+)(.*)$/
+
+function cmdShimIfExists (from, to, cb) {
+ fs.stat(from, function (er) {
+ if (er) return cb()
+ cmdShim(from, to, cb)
+ })
+}
+
+// Try to unlink, but ignore errors.
+// Any problems will surface later.
+function rm (path, cb) {
+ fs.unlink(path, function(er) {
+ cb()
+ })
+}
+
+function cmdShim (from, to, cb) {
+ fs.stat(from, function (er, stat) {
+ if (er)
+ return cb(er)
+
+ cmdShim_(from, to, cb)
+ })
+}
+
+function cmdShim_ (from, to, cb) {
+ var then = times(2, next, cb)
+ rm(to, then)
+ rm(to + ".cmd", then)
+
+ function next(er) {
+ writeShim(from, to, cb)
+ }
+}
+
+function writeShim (from, to, cb) {
+ // make a cmd file and a sh script
+ // First, check if the bin is a #! of some sort.
+ // If not, then assume it's something that'll be compiled, or some other
+ // sort of script, and just call it directly.
+ mkdir(path.dirname(to), function (er) {
+ if (er)
+ return cb(er)
+ fs.readFile(from, "utf8", function (er, data) {
+ if (er) return writeShim_(from, to, null, null, cb)
+ var firstLine = data.trim().split(/\r*\n/)[0]
+ , shebang = firstLine.match(shebangExpr)
+ if (!shebang) return writeShim_(from, to, null, null, cb)
+ var prog = shebang[1]
+ , args = shebang[2] || ""
+ return writeShim_(from, to, prog, args, cb)
+ })
+ })
+}
+
+function writeShim_ (from, to, prog, args, cb) {
+ var shTarget = path.relative(path.dirname(to), from)
+ , target = shTarget.split("/").join("\\")
+ , longProg
+ , shProg = prog && prog.split("\\").join("/")
+ , shLongProg
+ shTarget = shTarget.split("\\").join("/")
+ args = args || ""
+ if (!prog) {
+ prog = "\"%~dp0\\" + target + "\""
+ shProg = "\"$basedir/" + shTarget + "\""
+ args = ""
+ target = ""
+ shTarget = ""
+ } else {
+ longProg = "\"%~dp0\\" + prog + ".exe\""
+ shLongProg = "\"$basedir/" + prog + "\""
+ target = "\"%~dp0\\" + target + "\""
+ shTarget = "\"$basedir/" + shTarget + "\""
+ }
+
+ // @IF EXIST "%~dp0\node.exe" (
+ // "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
+ // ) ELSE (
+ // node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
+ // )
+ var cmd
+ if (longProg) {
+ cmd = "@IF EXIST " + longProg + " (\r\n"
+ + " " + longProg + " " + args + " " + target + " %*\r\n"
+ + ") ELSE (\r\n"
+ + " " + prog + " " + args + " " + target + " %*\r\n"
+ + ")"
+ } else {
+ cmd = prog + " " + args + " " + target + " %*\r\n"
+ }
+
+ // #!/bin/sh
+ // basedir=`dirname "$0"`
+ //
+ // case `uname` in
+ // *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+ // esac
+ //
+ // if [ -x "$basedir/node.exe" ]; then
+ // "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@"
+ // ret=$?
+ // else
+ // node "$basedir/node_modules/npm/bin/npm-cli.js" "$@"
+ // ret=$?
+ // fi
+ // exit $ret
+
+ var sh = "#!/bin/sh\n"
+
+ if (shLongProg) {
+ sh = sh
+ + "basedir=`dirname \"$0\"`\n"
+ + "\n"
+ + "case `uname` in\n"
+ + " *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;\n"
+ + "esac\n"
+ + "\n"
+
+ sh = sh
+ + "if [ -x "+shLongProg+" ]; then\n"
+ + " " + shLongProg + " " + args + " " + shTarget + " \"$@\"\n"
+ + " ret=$?\n"
+ + "else \n"
+ + " " + shProg + " " + args + " " + shTarget + " \"$@\"\n"
+ + " ret=$?\n"
+ + "fi\n"
+ + "exit $ret\n"
+ } else {
+ sh = shProg + " " + args + " " + shTarget + " \"$@\"\n"
+ + "exit $?\n"
+ }
+
+ var then = times(2, next, cb)
+ fs.writeFile(to + ".cmd", cmd, "utf8", then)
+ fs.writeFile(to, sh, "utf8", then)
+ function next () {
+ chmodShim(to, cb)
+ }
+}
+
+function chmodShim (to, cb) {
+ var then = times(2, cb, cb)
+ fs.chmod(to, 0755, then)
+ fs.chmod(to + ".cmd", 0755, then)
+}
+
+function times(n, ok, cb) {
+ var errState = null
+ return function(er) {
+ if (!errState) {
+ if (er)
+ cb(errState = er)
+ else if (--n === 0)
+ ok()
+ }
+ }
+}
{
"name": "cmd-shim",
- "version": "1.1.0",
+ "version": "1.0.1",
"description": "Used in npm for command line application support",
"scripts": {
"test": "tap test/*.js"
},
"license": "BSD",
"optionalDependencies": {
- "graceful-fs": "1.2"
+ "graceful-fs": "2"
},
"dependencies": {
"mkdirp": "~0.3.3",
- "graceful-fs": "1.2"
+ "graceful-fs": "2"
},
"devDependencies": {
"tap": "~0.4.1",
"rimraf": "~2.1.4"
},
- "readme": "# cmd-shim\r\n\r\nThe cmd-shim used in npm to create executable scripts on Windows,\r\nsince symlinks are not suitable for this purpose there.\r\n\r\nOn Unix systems, you should use a symbolic link instead.\r\n\r\n[![Build Status](https://travis-ci.org/ForbesLindesay/cmd-shim.png?branch=master)](https://travis-ci.org/ForbesLindesay/cmd-shim) [![Dependency Status](https://gemnasium.com/ForbesLindesay/cmd-shim.png)](https://gemnasium.com/ForbesLindesay/cmd-shim)\r\n\r\n## Installation\r\n\r\n```\r\nnpm install cmd-shim\r\n```\r\n\r\n## API\r\n\r\n### cmdShim(from, to, cb)\r\n\r\nCreate a cmd shim at `to` for the command line program at `from`.\r\ne.g.\r\n\r\n```javascript\r\nvar cmdShim = require('cmd-shim');\r\ncmdShim(__dirname + '/cli.js', '/usr/bin/command-name', function (err) {\r\n if (err) throw err;\r\n});\r\n```\r\n\r\n### cmdShim.ifExists(from, to, cb)\r\n\r\nThe same as above, but will just continue if the file does not exist.\r\nSource:\r\n\r\n```javascript\r\nfunction cmdShimIfExists (from, to, cb) {\r\n fs.stat(from, function (er) {\r\n if (er) return cb()\r\n cmdShim(from, to, cb)\r\n })\r\n}\r\n```\r\n",
+ "readme": "# cmd-shim\n\nThe cmd-shim used in npm to create executable scripts on Windows,\nsince symlinks are not suitable for this purpose there.\n\nOn Unix systems, you should use a symbolic link instead.\n\n## Installation\n\n```\nnpm install cmd-shim\n```\n\n## API\n\n### cmdShim(from, to, cb)\n\nCreate a cmd shim at `to` for the command line program at `from`.\ne.g.\n\n```javascript\nvar cmdShim = require('cmd-shim');\ncmdShim(__dirname + '/cli.js', '/usr/bin/command-name', function (err) {\n if (err) throw err;\n});\n```\n\n### cmdShim.ifExists(from, to, cb)\n\nThe same as above, but will just continue if the file does not exist.\nSource:\n\n```javascript\nfunction cmdShimIfExists (from, to, cb) {\n fs.stat(from, function (er) {\n if (er) return cb()\n cmdShim(from, to, cb)\n })\n}\n```\n",
"readmeFilename": "README.md",
- "_id": "cmd-shim@1.1.0",
- "_from": "cmd-shim@"
+ "bugs": {
+ "url": "https://github.com/ForbesLindesay/cmd-shim/issues"
+ },
+ "_id": "cmd-shim@1.0.1",
+ "_from": "cmd-shim@latest"
}
-var test = require('tap').test\r
-var mkdirp = require('mkdirp')\r
-var fs = require('fs')\r
-var path = require('path')\r
-var fixtures = path.resolve(__dirname, 'fixtures')\r
-\r
-var froms = {\r
- 'from.exe': 'exe',\r
- 'from.env': '#!/usr/bin/env node\nconsole.log(/hi/)\n',\r
- 'from.env.args': '#!/usr/bin/env node --expose_gc\ngc()\n',\r
- 'from.sh': '#!/usr/bin/sh\necho hi\n',\r
- 'from.sh.args': '#!/usr/bin/sh -x\necho hi\n'\r
-}\r
-\r
-var cmdShim = require('../')\r
-\r
-test('create fixture', function (t) {\r
- mkdirp(fixtures, function (er) {\r
- if (er)\r
- throw er\r
- t.pass('made dir')\r
- Object.keys(froms).forEach(function (f) {\r
- t.test('write ' + f, function (t) {\r
- fs.writeFile(path.resolve(fixtures, f), froms[f], function (er) {\r
- if (er)\r
- throw er\r
- t.pass('wrote ' + f)\r
- t.end()\r
- })\r
- })\r
- })\r
- t.end()\r
- })\r
-})\r
+var test = require('tap').test
+var mkdirp = require('mkdirp')
+var fs = require('fs')
+var path = require('path')
+var fixtures = path.resolve(__dirname, 'fixtures')
+var which = require('which')
+var whichTap = which.sync('tap')
+
+var froms = {
+ 'from.exe': 'exe',
+ 'from.env': '#!/usr/bin/env node\nconsole.log(/hi/)\n',
+ 'from.env.args': '#!/usr/bin/env node --expose_gc\ngc()\n',
+ 'from.sh': '#!/usr/bin/sh\necho hi\n',
+ 'from.sh.args': '#!/usr/bin/sh -x\necho hi\n'
+}
+
+var cmdShim = require('../')
+
+test('create fixture', function (t) {
+ mkdirp(fixtures, function (er) {
+ if (er)
+ throw er
+ t.pass('made dir')
+ Object.keys(froms).forEach(function (f) {
+ t.test('write ' + f, function (t) {
+ fs.writeFile(path.resolve(fixtures, f), froms[f], function (er) {
+ if (er)
+ throw er
+ t.pass('wrote ' + f)
+ t.end()
+ })
+ })
+ })
+ t.end()
+ })
+})
-var test = require('tap').test\r
-var mkdirp = require('mkdirp')\r
-var fs = require('fs')\r
-var path = require('path')\r
-var fixtures = path.resolve(__dirname, 'fixtures')\r
-\r
-var cmdShim = require('../')\r
-\r
-test('no shebang', function (t) {\r
- var from = path.resolve(fixtures, 'from.exe')\r
- var to = path.resolve(fixtures, 'exe.shim')\r
- cmdShim(from, to, function(er) {\r
- if (er)\r
- throw er\r
- t.equal(fs.readFileSync(to, 'utf8'),\r
- "\"$basedir/from.exe\" \"$@\"\nexit $?\n")\r
- t.equal(fs.readFileSync(to + '.cmd', 'utf8'),\r
- "\"%~dp0\\from.exe\" %*\r\n")\r
- t.end()\r
- })\r
-})\r
-\r
-test('env shebang', function (t) {\r
- var from = path.resolve(fixtures, 'from.env')\r
- var to = path.resolve(fixtures, 'env.shim')\r
- cmdShim(from, to, function(er) {\r
- if (er)\r
- throw er\r
- console.error('%j', fs.readFileSync(to, 'utf8'))\r
- console.error('%j', fs.readFileSync(to + '.cmd', 'utf8'))\r
-\r
- t.equal(fs.readFileSync(to, 'utf8'),\r
- "#!/bin/sh"+\r
- "\nbasedir=`dirname \"$0\"`"+\r
- "\n"+\r
- "\ncase `uname` in"+\r
- "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;"+\r
- "\nesac"+\r
- "\n"+\r
- "\nif [ -x \"$basedir/node\" ]; then"+\r
- "\n \"$basedir/node\" \"$basedir/from.env\" \"$@\""+\r
- "\n ret=$?"+\r
- "\nelse "+\r
- "\n node \"$basedir/from.env\" \"$@\""+\r
- "\n ret=$?"+\r
- "\nfi"+\r
- "\nexit $ret"+\r
- "\n")\r
- t.equal(fs.readFileSync(to + '.cmd', 'utf8'),\r
- "@IF EXIST \"%~dp0\\node.exe\" (\r"+\r
- "\n \"%~dp0\\node.exe\" \"%~dp0\\from.env\" %*\r"+\r
- "\n) ELSE (\r"+\r
- "\n node \"%~dp0\\from.env\" %*\r"+\r
- "\n)")\r
- t.end()\r
- })\r
-})\r
-\r
-test('env shebang with args', function (t) {\r
- var from = path.resolve(fixtures, 'from.env.args')\r
- var to = path.resolve(fixtures, 'env.args.shim')\r
- cmdShim(from, to, function(er) {\r
- if (er)\r
- throw er\r
- console.error('%j', fs.readFileSync(to, 'utf8'))\r
- console.error('%j', fs.readFileSync(to + '.cmd', 'utf8'))\r
-\r
- t.equal(fs.readFileSync(to, 'utf8'),\r
- "#!/bin/sh"+\r
- "\nbasedir=`dirname \"$0\"`"+\r
- "\n"+\r
- "\ncase `uname` in"+\r
- "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;"+\r
- "\nesac"+\r
- "\n"+\r
- "\nif [ -x \"$basedir/node\" ]; then"+\r
- "\n \"$basedir/node\" --expose_gc \"$basedir/from.env.args\" \"$@\""+\r
- "\n ret=$?"+\r
- "\nelse "+\r
- "\n node --expose_gc \"$basedir/from.env.args\" \"$@\""+\r
- "\n ret=$?"+\r
- "\nfi"+\r
- "\nexit $ret"+\r
- "\n")\r
- t.equal(fs.readFileSync(to + '.cmd', 'utf8'),\r
- "@IF EXIST \"%~dp0\\node.exe\" (\r"+\r
- "\n \"%~dp0\\node.exe\" --expose_gc \"%~dp0\\from.env.args\" %*\r"+\r
- "\n) ELSE (\r"+\r
- "\n node --expose_gc \"%~dp0\\from.env.args\" %*\r"+\r
- "\n)")\r
- t.end()\r
- })\r
-})\r
-\r
-test('explicit shebang', function (t) {\r
- var from = path.resolve(fixtures, 'from.sh')\r
- var to = path.resolve(fixtures, 'sh.shim')\r
- cmdShim(from, to, function(er) {\r
- if (er)\r
- throw er\r
- console.error('%j', fs.readFileSync(to, 'utf8'))\r
- console.error('%j', fs.readFileSync(to + '.cmd', 'utf8'))\r
-\r
- t.equal(fs.readFileSync(to, 'utf8'),\r
- "#!/bin/sh" +\r
- "\nbasedir=`dirname \"$0\"`" +\r
- "\n" +\r
- "\ncase `uname` in" +\r
- "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;" +\r
- "\nesac" +\r
- "\n" +\r
- "\nif [ -x \"$basedir//usr/bin/sh\" ]; then" +\r
- "\n \"$basedir//usr/bin/sh\" \"$basedir/from.sh\" \"$@\"" +\r
- "\n ret=$?" +\r
- "\nelse " +\r
- "\n /usr/bin/sh \"$basedir/from.sh\" \"$@\"" +\r
- "\n ret=$?" +\r
- "\nfi" +\r
- "\nexit $ret" +\r
- "\n")\r
-\r
- t.equal(fs.readFileSync(to + '.cmd', 'utf8'),\r
- "@IF EXIST \"%~dp0\\/usr/bin/sh.exe\" (\r" +\r
- "\n \"%~dp0\\/usr/bin/sh.exe\" \"%~dp0\\from.sh\" %*\r" +\r
- "\n) ELSE (\r" +\r
- "\n /usr/bin/sh \"%~dp0\\from.sh\" %*\r" +\r
- "\n)")\r
- t.end()\r
- })\r
-})\r
-\r
-test('explicit shebang with args', function (t) {\r
- var from = path.resolve(fixtures, 'from.sh.args')\r
- var to = path.resolve(fixtures, 'sh.args.shim')\r
- cmdShim(from, to, function(er) {\r
- if (er)\r
- throw er\r
- console.error('%j', fs.readFileSync(to, 'utf8'))\r
- console.error('%j', fs.readFileSync(to + '.cmd', 'utf8'))\r
-\r
- t.equal(fs.readFileSync(to, 'utf8'),\r
- "#!/bin/sh" +\r
- "\nbasedir=`dirname \"$0\"`" +\r
- "\n" +\r
- "\ncase `uname` in" +\r
- "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;" +\r
- "\nesac" +\r
- "\n" +\r
- "\nif [ -x \"$basedir//usr/bin/sh\" ]; then" +\r
- "\n \"$basedir//usr/bin/sh\" -x \"$basedir/from.sh.args\" \"$@\"" +\r
- "\n ret=$?" +\r
- "\nelse " +\r
- "\n /usr/bin/sh -x \"$basedir/from.sh.args\" \"$@\"" +\r
- "\n ret=$?" +\r
- "\nfi" +\r
- "\nexit $ret" +\r
- "\n")\r
-\r
- t.equal(fs.readFileSync(to + '.cmd', 'utf8'),\r
- "@IF EXIST \"%~dp0\\/usr/bin/sh.exe\" (\r" +\r
- "\n \"%~dp0\\/usr/bin/sh.exe\" -x \"%~dp0\\from.sh.args\" %*\r" +\r
- "\n) ELSE (\r" +\r
- "\n /usr/bin/sh -x \"%~dp0\\from.sh.args\" %*\r" +\r
- "\n)")\r
- t.end()\r
- })\r
-})\r
+var test = require('tap').test
+var mkdirp = require('mkdirp')
+var fs = require('fs')
+var path = require('path')
+var fixtures = path.resolve(__dirname, 'fixtures')
+var which = require('which')
+var whichTap = which.sync('tap')
+
+var cmdShim = require('../')
+
+test('no shebang', function (t) {
+ var from = path.resolve(fixtures, 'from.exe')
+ var to = path.resolve(fixtures, 'exe.shim')
+ cmdShim(from, to, function(er) {
+ if (er)
+ throw er
+ t.equal(fs.readFileSync(to, 'utf8'),
+ "\"$basedir/from.exe\" \"$@\"\nexit $?\n")
+ t.equal(fs.readFileSync(to + '.cmd', 'utf8'),
+ "\"%~dp0\\from.exe\" %*\r\n")
+ t.end()
+ })
+})
+
+test('env shebang', function (t) {
+ var from = path.resolve(fixtures, 'from.env')
+ var to = path.resolve(fixtures, 'env.shim')
+ cmdShim(from, to, function(er) {
+ if (er)
+ throw er
+ console.error('%j', fs.readFileSync(to, 'utf8'))
+ console.error('%j', fs.readFileSync(to + '.cmd', 'utf8'))
+
+ t.equal(fs.readFileSync(to, 'utf8'),
+ "#!/bin/sh"+
+ "\nbasedir=`dirname \"$0\"`"+
+ "\n"+
+ "\ncase `uname` in"+
+ "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;"+
+ "\nesac"+
+ "\n"+
+ "\nif [ -x \"$basedir/node\" ]; then"+
+ "\n \"$basedir/node\" \"$basedir/from.env\" \"$@\""+
+ "\n ret=$?"+
+ "\nelse "+
+ "\n node \"$basedir/from.env\" \"$@\""+
+ "\n ret=$?"+
+ "\nfi"+
+ "\nexit $ret"+
+ "\n")
+ t.equal(fs.readFileSync(to + '.cmd', 'utf8'),
+ "@IF EXIST \"%~dp0\\node.exe\" (\r"+
+ "\n \"%~dp0\\node.exe\" \"%~dp0\\from.env\" %*\r"+
+ "\n) ELSE (\r"+
+ "\n node \"%~dp0\\from.env\" %*\r"+
+ "\n)")
+ t.end()
+ })
+})
+
+test('env shebang with args', function (t) {
+ var from = path.resolve(fixtures, 'from.env.args')
+ var to = path.resolve(fixtures, 'env.args.shim')
+ cmdShim(from, to, function(er) {
+ if (er)
+ throw er
+ console.error('%j', fs.readFileSync(to, 'utf8'))
+ console.error('%j', fs.readFileSync(to + '.cmd', 'utf8'))
+
+ t.equal(fs.readFileSync(to, 'utf8'),
+ "#!/bin/sh"+
+ "\nbasedir=`dirname \"$0\"`"+
+ "\n"+
+ "\ncase `uname` in"+
+ "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;"+
+ "\nesac"+
+ "\n"+
+ "\nif [ -x \"$basedir/node\" ]; then"+
+ "\n \"$basedir/node\" --expose_gc \"$basedir/from.env.args\" \"$@\""+
+ "\n ret=$?"+
+ "\nelse "+
+ "\n node --expose_gc \"$basedir/from.env.args\" \"$@\""+
+ "\n ret=$?"+
+ "\nfi"+
+ "\nexit $ret"+
+ "\n")
+ t.equal(fs.readFileSync(to + '.cmd', 'utf8'),
+ "@IF EXIST \"%~dp0\\node.exe\" (\r"+
+ "\n \"%~dp0\\node.exe\" --expose_gc \"%~dp0\\from.env.args\" %*\r"+
+ "\n) ELSE (\r"+
+ "\n node --expose_gc \"%~dp0\\from.env.args\" %*\r"+
+ "\n)")
+ t.end()
+ })
+})
+
+test('explicit shebang', function (t) {
+ var from = path.resolve(fixtures, 'from.sh')
+ var to = path.resolve(fixtures, 'sh.shim')
+ cmdShim(from, to, function(er) {
+ if (er)
+ throw er
+ console.error('%j', fs.readFileSync(to, 'utf8'))
+ console.error('%j', fs.readFileSync(to + '.cmd', 'utf8'))
+
+ t.equal(fs.readFileSync(to, 'utf8'),
+ "#!/bin/sh" +
+ "\nbasedir=`dirname \"$0\"`" +
+ "\n" +
+ "\ncase `uname` in" +
+ "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;" +
+ "\nesac" +
+ "\n" +
+ "\nif [ -x \"$basedir//usr/bin/sh\" ]; then" +
+ "\n \"$basedir//usr/bin/sh\" \"$basedir/from.sh\" \"$@\"" +
+ "\n ret=$?" +
+ "\nelse " +
+ "\n /usr/bin/sh \"$basedir/from.sh\" \"$@\"" +
+ "\n ret=$?" +
+ "\nfi" +
+ "\nexit $ret" +
+ "\n")
+
+ t.equal(fs.readFileSync(to + '.cmd', 'utf8'),
+ "@IF EXIST \"%~dp0\\/usr/bin/sh.exe\" (\r" +
+ "\n \"%~dp0\\/usr/bin/sh.exe\" \"%~dp0\\from.sh\" %*\r" +
+ "\n) ELSE (\r" +
+ "\n /usr/bin/sh \"%~dp0\\from.sh\" %*\r" +
+ "\n)")
+ t.end()
+ })
+})
+
+test('explicit shebang with args', function (t) {
+ var from = path.resolve(fixtures, 'from.sh.args')
+ var to = path.resolve(fixtures, 'sh.args.shim')
+ cmdShim(from, to, function(er) {
+ if (er)
+ throw er
+ console.error('%j', fs.readFileSync(to, 'utf8'))
+ console.error('%j', fs.readFileSync(to + '.cmd', 'utf8'))
+
+ t.equal(fs.readFileSync(to, 'utf8'),
+ "#!/bin/sh" +
+ "\nbasedir=`dirname \"$0\"`" +
+ "\n" +
+ "\ncase `uname` in" +
+ "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;" +
+ "\nesac" +
+ "\n" +
+ "\nif [ -x \"$basedir//usr/bin/sh\" ]; then" +
+ "\n \"$basedir//usr/bin/sh\" -x \"$basedir/from.sh.args\" \"$@\"" +
+ "\n ret=$?" +
+ "\nelse " +
+ "\n /usr/bin/sh -x \"$basedir/from.sh.args\" \"$@\"" +
+ "\n ret=$?" +
+ "\nfi" +
+ "\nexit $ret" +
+ "\n")
+
+ t.equal(fs.readFileSync(to + '.cmd', 'utf8'),
+ "@IF EXIST \"%~dp0\\/usr/bin/sh.exe\" (\r" +
+ "\n \"%~dp0\\/usr/bin/sh.exe\" -x \"%~dp0\\from.sh.args\" %*\r" +
+ "\n) ELSE (\r" +
+ "\n /usr/bin/sh -x \"%~dp0\\from.sh.args\" %*\r" +
+ "\n)")
+ t.end()
+ })
+})
-var test = require('tap').test\r
-var path = require('path')\r
-var fixtures = path.resolve(__dirname, 'fixtures')\r
-var rimraf = require('rimraf')\r
-\r
-test('cleanup', function(t) {\r
- rimraf(fixtures, function(er) {\r
- if (er)\r
- throw er\r
- t.pass('cleaned up')\r
- t.end()\r
- })\r
-})\r
+var test = require('tap').test
+var path = require('path')
+var fixtures = path.resolve(__dirname, 'fixtures')
+var rimraf = require('rimraf')
+
+test('cleanup', function(t) {
+ rimraf(fixtures, function(er) {
+ if (er)
+ throw er
+ t.pass('cleaned up')
+ t.end()
+ })
+})
},
"name": "fstream-ignore",
"description": "A thing for ignoring files based on globs",
- "version": "0.0.6",
+ "version": "0.0.7",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/fstream-ignore.git"
"dependencies": {
"minimatch": "~0.2.0",
"fstream": "~0.1.17",
- "inherits": "~1.0.0"
+ "inherits": "2"
},
"devDependencies": {
"tap": "",
"license": "BSD",
"readme": "# fstream-ignore\n\nA fstream DirReader that filters out files that match globs in `.ignore`\nfiles throughout the tree, like how git ignores files based on a\n`.gitignore` file.\n\nHere's an example:\n\n```javascript\nvar Ignore = require(\"fstream-ignore\")\nIgnore({ path: __dirname\n , ignoreFiles: [\".ignore\", \".gitignore\"]\n })\n .on(\"child\", function (c) {\n console.error(c.path.substr(c.root.path.length + 1))\n })\n .pipe(tar.Pack())\n .pipe(fs.createWriteStream(\"foo.tar\"))\n```\n\nThis will tar up the files in __dirname into `foo.tar`, ignoring\nanything matched by the globs in any .iginore or .gitignore file.\n",
"readmeFilename": "README.md",
- "_id": "fstream-ignore@0.0.6",
+ "bugs": {
+ "url": "https://github.com/isaacs/fstream-ignore/issues"
+ },
+ "_id": "fstream-ignore@0.0.7",
"_from": "fstream-ignore@~0.0.5"
}
},
"name": "fstream-npm",
"description": "fstream class for creating npm packages",
- "version": "0.1.4",
+ "version": "0.1.5",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/fstream-npm.git"
"main": "./fstream-npm.js",
"dependencies": {
"fstream-ignore": "~0.0.5",
- "inherits": ""
+ "inherits": "2"
},
"license": "BSD",
"readme": "# fstream-npm\n\nThis is an fstream DirReader class that will read a directory and filter\nthings according to the semantics of what goes in an npm package.\n\nFor example:\n\n```javascript\n// This will print out all the files that would be included\n// by 'npm publish' or 'npm install' of this directory.\n\nvar FN = require(\"fstream-npm\")\nFN({ path: \"./\" })\n .on(\"child\", function (e) {\n console.error(e.path.substr(e.root.path.length + 1))\n })\n```\n\n",
"readmeFilename": "README.md",
- "_id": "fstream-npm@0.1.4",
- "_from": "fstream-npm@latest"
+ "bugs": {
+ "url": "https://github.com/isaacs/fstream-npm/issues"
+ },
+ "_id": "fstream-npm@0.1.5",
+ "_from": "fstream-npm@~0.1.3"
}
},
"name": "fstream",
"description": "Advanced file system stream things",
- "version": "0.1.23",
+ "version": "0.1.24",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/fstream.git"
"rimraf": "2",
"mkdirp": "0.3",
"graceful-fs": "~2.0.0",
- "inherits": "~1.0.0"
+ "inherits": "~2.0.0"
},
"devDependencies": {
"tap": ""
"bugs": {
"url": "https://github.com/isaacs/fstream/issues"
},
- "_id": "fstream@0.1.23",
+ "_id": "fstream@0.1.24",
"_from": "fstream@latest"
}
+++ /dev/null
- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
- Version 2, December 2004
-
- Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
-
- Everyone is permitted to copy and distribute verbatim or modified
- copies of this license document, and changing it is allowed as long
- as the name is changed.
-
- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. You just DO WHAT THE FUCK YOU WANT TO.
-
+++ /dev/null
-Browser-friendly inheritance fully compatible with standard node.js
-[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
-
-This package exports standard `inherits` from node.js `util` module in
-node environment, but also provides alternative browser-friendly
-implementation through [browser
-field](https://gist.github.com/shtylman/4339901). Alternative
-implementation is a literal copy of standard one located in standalone
-module to avoid requiring of `util`. It also has a shim for old
-browsers with no `Object.create` support.
-
-While keeping you sure you are using standard `inherits`
-implementation in node.js environment, it allows bundlers such as
-[browserify](https://github.com/substack/node-browserify) to not
-include full `util` package to your client code if all you need is
-just `inherits` function. It worth, because browser shim for `util`
-package is large and `inherits` is often the single function you need
-from it.
-
-It's recommended to use this package instead of
-`require('util').inherits` for any code that has chances to be used
-not only in node.js but in browser too.
-
-## usage
-
-```js
-var inherits = require('inherits');
-// then use exactly as the standard one
-```
-
-## note on version ~1.0
-
-Version ~1.0 had completely different motivation and is not compatible
-neither with 2.0 nor with standard node.js `inherits`.
-
-If you are using version ~1.0 and planning to switch to ~2.0, be
-careful:
-
-* new version uses `super_` instead of `super` for referencing
- superclass
-* new version overwrites current prototype while old one preserves any
- existing fields on it
+++ /dev/null
-module.exports = require('util').inherits
+++ /dev/null
-if (typeof Object.create === 'function') {
- // implementation from standard node.js 'util' module
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- };
-} else {
- // old school shim for old browsers
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- var TempCtor = function () {}
- TempCtor.prototype = superCtor.prototype
- ctor.prototype = new TempCtor()
- ctor.prototype.constructor = ctor
- }
-}
+++ /dev/null
-{
- "name": "inherits",
- "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
- "version": "2.0.0",
- "keywords": [
- "inheritance",
- "class",
- "klass",
- "oop",
- "object-oriented",
- "inherits",
- "browser",
- "browserify"
- ],
- "main": "./inherits.js",
- "browser": "./inherits_browser.js",
- "repository": {
- "type": "git",
- "url": "https://github.com/isaacs/inherits"
- },
- "license": {
- "type": "WTFPL2"
- },
- "author": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me/"
- },
- "scripts": {
- "test": "node test"
- },
- "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/isaacs/inherits/issues"
- },
- "_id": "inherits@2.0.0",
- "_from": "inherits@2"
-}
+++ /dev/null
-var inherits = require('./inherits.js')
-var assert = require('assert')
-
-function test(c) {
- assert(c.constructor === Child)
- assert(c.constructor.super_ === Parent)
- assert(Object.getPrototypeOf(c) === Child.prototype)
- assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype)
- assert(c instanceof Child)
- assert(c instanceof Parent)
-}
-
-function Child() {
- Parent.call(this)
- test(this)
-}
-
-function Parent() {}
-
-inherits(Child, Parent)
-
-var c = new Child
-test(c)
-
-console.log('ok')
-A dead simple way to do inheritance in JS.
-
- var inherits = require("inherits")
-
- function Animal () {
- this.alive = true
- }
- Animal.prototype.say = function (what) {
- console.log(what)
- }
-
- inherits(Dog, Animal)
- function Dog () {
- Dog.super.apply(this)
- }
- Dog.prototype.sniff = function () {
- this.say("sniff sniff")
- }
- Dog.prototype.bark = function () {
- this.say("woof woof")
- }
-
- inherits(Chihuahua, Dog)
- function Chihuahua () {
- Chihuahua.super.apply(this)
- }
- Chihuahua.prototype.bark = function () {
- this.say("yip yip")
- }
-
- // also works
- function Cat () {
- Cat.super.apply(this)
- }
- Cat.prototype.hiss = function () {
- this.say("CHSKKSS!!")
- }
- inherits(Cat, Animal, {
- meow: function () { this.say("miao miao") }
- })
- Cat.prototype.purr = function () {
- this.say("purr purr")
- }
-
-
- var c = new Chihuahua
- assert(c instanceof Chihuahua)
- assert(c instanceof Dog)
- assert(c instanceof Animal)
-
-The actual function is laughably small. 10-lines small.
+Browser-friendly inheritance fully compatible with standard node.js
+[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
+
+This package exports standard `inherits` from node.js `util` module in
+node environment, but also provides alternative browser-friendly
+implementation through [browser
+field](https://gist.github.com/shtylman/4339901). Alternative
+implementation is a literal copy of standard one located in standalone
+module to avoid requiring of `util`. It also has a shim for old
+browsers with no `Object.create` support.
+
+While keeping you sure you are using standard `inherits`
+implementation in node.js environment, it allows bundlers such as
+[browserify](https://github.com/substack/node-browserify) to not
+include full `util` package to your client code if all you need is
+just `inherits` function. It worth, because browser shim for `util`
+package is large and `inherits` is often the single function you need
+from it.
+
+It's recommended to use this package instead of
+`require('util').inherits` for any code that has chances to be used
+not only in node.js but in browser too.
+
+## usage
+
+```js
+var inherits = require('inherits');
+// then use exactly as the standard one
+```
+
+## note on version ~1.0
+
+Version ~1.0 had completely different motivation and is not compatible
+neither with 2.0 nor with standard node.js `inherits`.
+
+If you are using version ~1.0 and planning to switch to ~2.0, be
+careful:
+
+* new version uses `super_` instead of `super` for referencing
+ superclass
+* new version overwrites current prototype while old one preserves any
+ existing fields on it
+++ /dev/null
-// This is a less perfect implementation of the inherits function,
-// designed to work in cases where ES5 is not available.
-//
-// Note that it is a bit longer, and doesn't properly deal with
-// getter/setters or property descriptor flags (enumerable, etc.)
-
-module.exports = inheritsOld
-
-function inheritsOld (c, p, proto) {
- function F () { this.constructor = c }
- F.prototype = p.prototype
- var e = {}
- for (var i in c.prototype) if (c.prototype.hasOwnProperty(i)) {
- e[i] = c.prototype[i]
- }
- if (proto) for (var i in proto) if (proto.hasOwnProperty(i)) {
- e[i] = proto[i]
- }
- c.prototype = new F()
- for (var i in e) if (e.hasOwnProperty(i)) {
- c.prototype[i] = e[i]
- }
- c.super = p
-}
-
-// function Child () {
-// Child.super.call(this)
-// console.error([this
-// ,this.constructor
-// ,this.constructor === Child
-// ,this.constructor.super === Parent
-// ,Object.getPrototypeOf(this) === Child.prototype
-// ,Object.getPrototypeOf(Object.getPrototypeOf(this))
-// === Parent.prototype
-// ,this instanceof Child
-// ,this instanceof Parent])
-// }
-// function Parent () {}
-// inheritsOld(Child, Parent)
-// new Child
-module.exports = inherits
-
-function inherits (c, p, proto) {
- proto = proto || {}
- var e = {}
- ;[c.prototype, proto].forEach(function (s) {
- Object.getOwnPropertyNames(s).forEach(function (k) {
- e[k] = Object.getOwnPropertyDescriptor(s, k)
- })
- })
- c.prototype = Object.create(p.prototype, e)
- c.super = p
-}
-
-//function Child () {
-// Child.super.call(this)
-// console.error([this
-// ,this.constructor
-// ,this.constructor === Child
-// ,this.constructor.super === Parent
-// ,Object.getPrototypeOf(this) === Child.prototype
-// ,Object.getPrototypeOf(Object.getPrototypeOf(this))
-// === Parent.prototype
-// ,this instanceof Child
-// ,this instanceof Parent])
-//}
-//function Parent () {}
-//inherits(Child, Parent)
-//new Child
+module.exports = require('util').inherits
{
"name": "inherits",
- "description": "A tiny simple way to do classic inheritance in js",
- "version": "1.0.0",
+ "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
+ "version": "2.0.0",
"keywords": [
"inheritance",
"class",
"klass",
"oop",
- "object-oriented"
+ "object-oriented",
+ "inherits",
+ "browser",
+ "browserify"
],
"main": "./inherits.js",
+ "browser": "./inherits_browser.js",
"repository": {
"type": "git",
- "url": "git://github.com/isaacs/inherits.git"
+ "url": "https://github.com/isaacs/inherits"
},
"license": {
"type": "WTFPL2"
"email": "i@izs.me",
"url": "http://blog.izs.me/"
},
- "_npmUser": {
- "name": "isaacs",
- "email": "i@izs.me"
+ "scripts": {
+ "test": "node test"
},
- "_id": "inherits@1.0.0",
- "dependencies": {},
- "devDependencies": {},
- "optionalDependencies": {},
- "engines": {
- "node": "*"
+ "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/isaacs/inherits/issues"
},
- "_engineSupported": true,
- "_npmVersion": "1.1.10",
- "_nodeVersion": "v0.7.7-pre",
- "_defaultsLoaded": true,
- "dist": {
- "shasum": "12dbc03c9f7c203289234b214a7d05a311d71450"
- },
- "_from": "git://github.com/isaacs/inherits"
+ "_id": "inherits@2.0.0",
+ "_from": "inherits@2"
}
break
}
var hadEq = false
- if (arg.charAt(0) === "-") {
+ if (arg.charAt(0) === "-" && arg.length > 1) {
if (arg.indexOf("=") !== -1) {
hadEq = true
var v = arg.split("=")
,[]
,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean}
,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}]
+ ,["--file -"
+ ,{"file":"-"}
+ ,[]
+ ,{file:String}
+ ,{}]
+ ,["--file -"
+ ,{"file":true}
+ ,["-"]
+ ,{file:Boolean}
+ ,{}]
].forEach(function (test) {
var argv = test[0].split(/\s+/)
, opts = test[1]
{
"name": "nopt",
- "version": "2.1.1",
+ "version": "2.1.2",
"description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.",
"author": {
"name": "Isaac Z. Schlueter",
},
"readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many\" : [String, Array]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk 1000 -fp # unknown opts are ok.\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --blatzk true -fp # but they need a value\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents, and numeric values will be\ninterpreted as a number.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null. When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n",
"readmeFilename": "README.md",
- "_id": "nopt@2.1.1",
+ "bugs": {
+ "url": "https://github.com/isaacs/nopt/issues"
+ },
+ "_id": "nopt@2.1.2",
"_from": "nopt@latest"
}
{
"name": "npmconf",
- "version": "0.1.1",
+ "version": "0.1.2",
"description": "The config thing npm uses",
"main": "npmconf.js",
"directories": {
},
"dependencies": {
"config-chain": "~1.1.1",
- "inherits": "~1.0.0",
+ "inherits": "~2.0.0",
"once": "~1.1.1",
"mkdirp": "~0.3.3",
"osenv": "0.0.3",
"bugs": {
"url": "https://github.com/isaacs/npmconf/issues"
},
- "_id": "npmconf@0.1.1",
+ "_id": "npmconf@0.1.2",
"_from": "npmconf@latest"
}
{
"name": "read-installed",
"description": "Read all the installed packages in a folder, and return a tree structure with all the data.",
- "version": "0.2.2",
+ "version": "0.2.3",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/read-installed"
"semver": "2",
"slide": "~1.1.3",
"read-package-json": "1",
- "graceful-fs": "~1.2.0"
+ "graceful-fs": "~2"
},
"optionalDependencies": {
- "graceful-fs": "~1.2.0"
+ "graceful-fs": "~2"
},
"author": {
"name": "Isaac Z. Schlueter",
"bugs": {
"url": "https://github.com/isaacs/read-installed/issues"
},
- "_id": "read-installed@0.2.2",
+ "_id": "read-installed@0.2.3",
"_from": "read-installed@latest"
}
}
console.error('the package data is', data)
-}
+});
```
## readJson(file, [logFn = noop], [strict = false], cb)
{
"name": "read-package-json",
- "version": "1.1.0",
+ "version": "1.1.1",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
"glob": "~3.2.1",
"lru-cache": "2",
"normalize-package-data": "~0.2",
- "graceful-fs": "~1.2"
+ "graceful-fs": "2"
},
"devDependencies": {
"tap": "~0.2.5"
},
"optionalDependencies": {
- "graceful-fs": "~1.2"
+ "graceful-fs": "2"
},
- "readme": "# read-package-json\n\nThis is the thing that npm uses to read package.json files. It\nvalidates some stuff, and loads some default things.\n\nIt keeps a cache of the files you've read, so that you don't end\nup reading the same package.json file multiple times.\n\nNote that if you just want to see what's literally in the package.json\nfile, you can usually do `var data = require('some-module/package.json')`.\n\nThis module is basically only needed by npm, but it's handy to see what\nnpm will see when it looks at your package.\n\n## Usage\n\n```javascript\nvar readJson = require('read-package-json')\n\n// readJson(filename, [logFunction=noop], [strict=false], cb)\nreadJson('/path/to/package.json', console.error, false, function (er, data) {\n if (er) {\n console.error(\"There was an error reading the file\")\n return\n }\n\n console.error('the package data is', data)\n}\n```\n\n## readJson(file, [logFn = noop], [strict = false], cb)\n\n* `file` {String} The path to the package.json file\n* `logFn` {Function} Function to handle logging. Defaults to a noop.\n* `strict` {Boolean} True to enforce SemVer 2.0 version strings, and\n other strict requirements.\n* `cb` {Function} Gets called with `(er, data)`, as is The Node Way.\n\nReads the JSON file and does the things.\n\n## `package.json` Fields\n\nSee `man 5 package.json` or `npm help json`.\n\n## readJson.log\n\nBy default this is a reference to the `npmlog` module. But if that\nmodule can't be found, then it'll be set to just a dummy thing that does\nnothing.\n\nReplace with your own `{log,warn,error}` object for fun loggy time.\n\n## readJson.extras(file, data, cb)\n\nRun all the extra stuff relative to the file, with the parsed data.\n\nModifies the data as it does stuff. Calls the cb when it's done.\n\n## readJson.extraSet = [fn, fn, ...]\n\nArray of functions that are called by `extras`. Each one receives the\narguments `fn(file, data, cb)` and is expected to call `cb(er, data)`\nwhen done or when an error occurs.\n\nOrder is indeterminate, so each function should be completely\nindependent.\n\nMix and match!\n\n## readJson.cache\n\nThe `lru-cache` object that readJson uses to not read the same file over\nand over again. See\n[lru-cache](https://github.com/isaacs/node-lru-cache) for details.\n\n## Other Relevant Files Besides `package.json`\n\nSome other files have an effect on the resulting data object, in the\nfollowing ways:\n\n### `README?(.*)`\n\nIf there is a `README` or `README.*` file present, then npm will attach\na `readme` field to the data with the contents of this file.\n\nOwing to the fact that roughly 100% of existing node modules have\nMarkdown README files, it will generally be assumed to be Markdown,\nregardless of the extension. Please plan accordingly.\n\n### `server.js`\n\nIf there is a `server.js` file, and there is not already a\n`scripts.start` field, then `scripts.start` will be set to `node\nserver.js`.\n\n### `AUTHORS`\n\nIf there is not already a `contributors` field, then the `contributors`\nfield will be set to the contents of the `AUTHORS` file, split by lines,\nand parsed.\n\n### `bindings.gyp`\n\nIf a bindings.gyp file exists, and there is not already a\n`scripts.install` field, then the `scripts.install` field will be set to\n`node-gyp rebuild`.\n\n### `wscript`\n\nIf a wscript file exists, and there is not already a `scripts.install`\nfield, then the `scripts.install` field will be set to `node-waf clean ;\nnode-waf configure build`.\n\nNote that the `bindings.gyp` file supercedes this, since node-waf has\nbeen deprecated in favor of node-gyp.\n\n### `index.js`\n\nIf the json file does not exist, but there is a `index.js` file\npresent instead, and that file has a package comment, then it will try\nto parse the package comment, and use that as the data instead.\n\nA package comment looks like this:\n\n```javascript\n/**package\n * { \"name\": \"my-bare-module\"\n * , \"version\": \"1.2.3\"\n * , \"description\": \"etc....\" }\n **/\n\n// or...\n\n/**package\n{ \"name\": \"my-bare-module\"\n, \"version\": \"1.2.3\"\n, \"description\": \"etc....\" }\n**/\n```\n\nThe important thing is that it starts with `/**package`, and ends with\n`**/`. If the package.json file exists, then the index.js is not\nparsed.\n\n### `{directories.man}/*.[0-9]`\n\nIf there is not already a `man` field defined as an array of files or a\nsingle file, and\nthere is a `directories.man` field defined, then that directory will\nbe searched for manpages.\n\nAny valid manpages found in that directory will be assigned to the `man`\narray, and installed in the appropriate man directory at package install\ntime, when installed globally on a Unix system.\n\n### `{directories.bin}/*`\n\nIf there is not already a `bin` field defined as a string filename or a\nhash of `<name> : <filename>` pairs, then the `directories.bin`\ndirectory will be searched and all the files within it will be linked as\nexecutables at install time.\n\nWhen installing locally, npm links bins into `node_modules/.bin`, which\nis in the `PATH` environ when npm runs scripts. When\ninstalling globally, they are linked into `{prefix}/bin`, which is\npresumably in the `PATH` environment variable.\n",
+ "readme": "# read-package-json\n\nThis is the thing that npm uses to read package.json files. It\nvalidates some stuff, and loads some default things.\n\nIt keeps a cache of the files you've read, so that you don't end\nup reading the same package.json file multiple times.\n\nNote that if you just want to see what's literally in the package.json\nfile, you can usually do `var data = require('some-module/package.json')`.\n\nThis module is basically only needed by npm, but it's handy to see what\nnpm will see when it looks at your package.\n\n## Usage\n\n```javascript\nvar readJson = require('read-package-json')\n\n// readJson(filename, [logFunction=noop], [strict=false], cb)\nreadJson('/path/to/package.json', console.error, false, function (er, data) {\n if (er) {\n console.error(\"There was an error reading the file\")\n return\n }\n\n console.error('the package data is', data)\n});\n```\n\n## readJson(file, [logFn = noop], [strict = false], cb)\n\n* `file` {String} The path to the package.json file\n* `logFn` {Function} Function to handle logging. Defaults to a noop.\n* `strict` {Boolean} True to enforce SemVer 2.0 version strings, and\n other strict requirements.\n* `cb` {Function} Gets called with `(er, data)`, as is The Node Way.\n\nReads the JSON file and does the things.\n\n## `package.json` Fields\n\nSee `man 5 package.json` or `npm help json`.\n\n## readJson.log\n\nBy default this is a reference to the `npmlog` module. But if that\nmodule can't be found, then it'll be set to just a dummy thing that does\nnothing.\n\nReplace with your own `{log,warn,error}` object for fun loggy time.\n\n## readJson.extras(file, data, cb)\n\nRun all the extra stuff relative to the file, with the parsed data.\n\nModifies the data as it does stuff. Calls the cb when it's done.\n\n## readJson.extraSet = [fn, fn, ...]\n\nArray of functions that are called by `extras`. Each one receives the\narguments `fn(file, data, cb)` and is expected to call `cb(er, data)`\nwhen done or when an error occurs.\n\nOrder is indeterminate, so each function should be completely\nindependent.\n\nMix and match!\n\n## readJson.cache\n\nThe `lru-cache` object that readJson uses to not read the same file over\nand over again. See\n[lru-cache](https://github.com/isaacs/node-lru-cache) for details.\n\n## Other Relevant Files Besides `package.json`\n\nSome other files have an effect on the resulting data object, in the\nfollowing ways:\n\n### `README?(.*)`\n\nIf there is a `README` or `README.*` file present, then npm will attach\na `readme` field to the data with the contents of this file.\n\nOwing to the fact that roughly 100% of existing node modules have\nMarkdown README files, it will generally be assumed to be Markdown,\nregardless of the extension. Please plan accordingly.\n\n### `server.js`\n\nIf there is a `server.js` file, and there is not already a\n`scripts.start` field, then `scripts.start` will be set to `node\nserver.js`.\n\n### `AUTHORS`\n\nIf there is not already a `contributors` field, then the `contributors`\nfield will be set to the contents of the `AUTHORS` file, split by lines,\nand parsed.\n\n### `bindings.gyp`\n\nIf a bindings.gyp file exists, and there is not already a\n`scripts.install` field, then the `scripts.install` field will be set to\n`node-gyp rebuild`.\n\n### `wscript`\n\nIf a wscript file exists, and there is not already a `scripts.install`\nfield, then the `scripts.install` field will be set to `node-waf clean ;\nnode-waf configure build`.\n\nNote that the `bindings.gyp` file supercedes this, since node-waf has\nbeen deprecated in favor of node-gyp.\n\n### `index.js`\n\nIf the json file does not exist, but there is a `index.js` file\npresent instead, and that file has a package comment, then it will try\nto parse the package comment, and use that as the data instead.\n\nA package comment looks like this:\n\n```javascript\n/**package\n * { \"name\": \"my-bare-module\"\n * , \"version\": \"1.2.3\"\n * , \"description\": \"etc....\" }\n **/\n\n// or...\n\n/**package\n{ \"name\": \"my-bare-module\"\n, \"version\": \"1.2.3\"\n, \"description\": \"etc....\" }\n**/\n```\n\nThe important thing is that it starts with `/**package`, and ends with\n`**/`. If the package.json file exists, then the index.js is not\nparsed.\n\n### `{directories.man}/*.[0-9]`\n\nIf there is not already a `man` field defined as an array of files or a\nsingle file, and\nthere is a `directories.man` field defined, then that directory will\nbe searched for manpages.\n\nAny valid manpages found in that directory will be assigned to the `man`\narray, and installed in the appropriate man directory at package install\ntime, when installed globally on a Unix system.\n\n### `{directories.bin}/*`\n\nIf there is not already a `bin` field defined as a string filename or a\nhash of `<name> : <filename>` pairs, then the `directories.bin`\ndirectory will be searched and all the files within it will be linked as\nexecutables at install time.\n\nWhen installing locally, npm links bins into `node_modules/.bin`, which\nis in the `PATH` environ when npm runs scripts. When\ninstalling globally, they are linked into `{prefix}/bin`, which is\npresumably in the `PATH` environment variable.\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/read-package-json/issues"
},
- "_id": "read-package-json@1.1.0",
- "_from": "read-package-json@1"
+ "_id": "read-package-json@1.1.1",
+ "dist": {
+ "shasum": "5d679b34ddf53ac3bc232aeb421f6b6857f925e5"
+ },
+ "_from": "read-package-json@1.1.1",
+ "_resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-1.1.1.tgz"
}
* `default` The default value if the user enters nothing.
* `edit` Allow the user to edit the default value.
* `terminal` Treat the output as a TTY, whether it is or not.
-* `stdin` Readable stream to get input data from. (default `process.stdin`)
-* `stdout` Writeable stream to write prompts to. (default: `process.stdout`)
+* `input` Readable stream to get input data from. (default `process.stdin`)
+* `output` Writeable stream to write prompts to. (default: `process.stdout`)
If silent is true, and the input is a TTY, then read will set raw
mode, and read character by character.
var input = opts.input || process.stdin
var output = opts.output || process.stdout
- var m = new Mute({ replace: opts.replace })
- m.pipe(output, {end: false})
- output = m
- var def = opts.default || ''
- var terminal = !!(opts.terminal || output.isTTY)
- var rlOpts = { input: input, output: output, terminal: terminal }
-
- if (process.version.match(/^v0\.6/)) {
- var rl = readline.createInterface(rlOpts.input, rlOpts.output)
- } else {
- var rl = readline.createInterface(rlOpts)
- }
-
var prompt = (opts.prompt || '').trim() + ' '
var silent = opts.silent
var editDef = false
var timeout = opts.timeout
+ var def = opts.default || ''
if (def) {
if (silent) {
prompt += '(<default hidden>) '
prompt += '(' + def + ') '
}
}
+ var terminal = !!(opts.terminal || output.isTTY)
+
+ var m = new Mute({ replace: opts.replace, prompt: prompt })
+ m.pipe(output, {end: false})
+ output = m
+ var rlOpts = { input: input, output: output, terminal: terminal }
+
+ if (process.version.match(/^v0\.6/)) {
+ var rl = readline.createInterface(rlOpts.input, rlOpts.output)
+ } else {
+ var rl = readline.createInterface(rlOpts)
+ }
+
output.unmute()
rl.setPrompt(prompt)
specified string when muted. (So you can show `****` instead of the
password, for example.)
+* `prompt` If you are using a replacement char, and also using a
+ prompt with a readline stream (as for a `Password: *****` input),
+ then specify what the prompt is so that backspace will work
+ properly. Otherwise, pressing backspace will overwrite the prompt
+ with the replacement character, which is weird.
+
## ms.mute()
Set `muted` to `true`. Turns `.write()` into a no-op.
this.muted = false
this.on('pipe', this._onpipe)
this.replace = opts.replace
+
+ // For readline-type situations
+ // This much at the start of a line being redrawn after a ctrl char
+ // is seen (such as backspace) won't be redrawn as the replacement
+ this._prompt = opts.prompt || null
+ this._hadControl = false
}
MuteStream.prototype = Object.create(Stream.prototype)
MuteStream.prototype.write = function (c) {
if (this.muted) {
if (!this.replace) return true
- c = c.toString().replace(/./g, this.replace)
+ if (c.match(/^\u001b/)) {
+ this._hadControl = true
+ return this.emit('data', c)
+ } else {
+ if (this._prompt && this._hadControl &&
+ c.indexOf(this._prompt) === 0) {
+ this._hadControl = false
+ this.emit('data', this._prompt)
+ c = c.substr(this._prompt.length)
+ }
+ c = c.toString().replace(/./g, this.replace)
+ }
}
this.emit('data', c)
}
{
"name": "mute-stream",
- "version": "0.0.3",
+ "version": "0.0.4",
"main": "mute.js",
"directories": {
"test": "test"
},
"license": "BSD",
"description": "Bytes go in, but they don't come out (when muted).",
- "readme": "# mute-stream\n\nBytes go in, but they don't come out (when muted).\n\nThis is a basic pass-through stream, but when muted, the bytes are\nsilently dropped, rather than being passed through.\n\n## Usage\n\n```javascript\nvar MuteStream = require('mute-stream')\n\nvar ms = new MuteStream(options)\n\nms.pipe(process.stdout)\nms.write('foo') // writes 'foo' to stdout\nms.mute()\nms.write('bar') // does not write 'bar'\nms.unmute()\nms.write('baz') // writes 'baz' to stdout\n\n// can also be used to mute incoming data\nvar ms = new MuteStream\ninput.pipe(ms)\n\nms.on('data', function (c) {\n console.log('data: ' + c)\n})\n\ninput.emit('data', 'foo') // logs 'foo'\nms.mute()\ninput.emit('data', 'bar') // does not log 'bar'\nms.unmute()\ninput.emit('data', 'baz') // logs 'baz'\n```\n\n## Options\n\nAll options are optional.\n\n* `replace` Set to a string to replace each character with the\n specified string when muted. (So you can show `****` instead of the\n password, for example.)\n\n## ms.mute()\n\nSet `muted` to `true`. Turns `.write()` into a no-op.\n\n## ms.unmute()\n\nSet `muted` to `false`\n\n## ms.isTTY\n\nTrue if the pipe destination is a TTY, or if the incoming pipe source is\na TTY.\n\n## Other stream methods...\n\nThe other standard readable and writable stream methods are all\navailable. The MuteStream object acts as a facade to its pipe source\nand destination.\n",
- "_id": "mute-stream@0.0.3",
- "_from": "mute-stream@~0.0.2"
+ "readme": "# mute-stream\n\nBytes go in, but they don't come out (when muted).\n\nThis is a basic pass-through stream, but when muted, the bytes are\nsilently dropped, rather than being passed through.\n\n## Usage\n\n```javascript\nvar MuteStream = require('mute-stream')\n\nvar ms = new MuteStream(options)\n\nms.pipe(process.stdout)\nms.write('foo') // writes 'foo' to stdout\nms.mute()\nms.write('bar') // does not write 'bar'\nms.unmute()\nms.write('baz') // writes 'baz' to stdout\n\n// can also be used to mute incoming data\nvar ms = new MuteStream\ninput.pipe(ms)\n\nms.on('data', function (c) {\n console.log('data: ' + c)\n})\n\ninput.emit('data', 'foo') // logs 'foo'\nms.mute()\ninput.emit('data', 'bar') // does not log 'bar'\nms.unmute()\ninput.emit('data', 'baz') // logs 'baz'\n```\n\n## Options\n\nAll options are optional.\n\n* `replace` Set to a string to replace each character with the\n specified string when muted. (So you can show `****` instead of the\n password, for example.)\n\n* `prompt` If you are using a replacement char, and also using a\n prompt with a readline stream (as for a `Password: *****` input),\n then specify what the prompt is so that backspace will work\n properly. Otherwise, pressing backspace will overwrite the prompt\n with the replacement character, which is weird.\n\n## ms.mute()\n\nSet `muted` to `true`. Turns `.write()` into a no-op.\n\n## ms.unmute()\n\nSet `muted` to `false`\n\n## ms.isTTY\n\nTrue if the pipe destination is a TTY, or if the incoming pipe source is\na TTY.\n\n## Other stream methods...\n\nThe other standard readable and writable stream methods are all\navailable. The MuteStream object acts as a facade to its pipe source\nand destination.\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/isaacs/mute-stream/issues"
+ },
+ "_id": "mute-stream@0.0.4",
+ "_from": "mute-stream@~0.0.4"
}
write: {
value: function (c) {
this.emit('data', c)
+ return true
}
},
end: {
{
"name": "read",
- "version": "1.0.4",
+ "version": "1.0.5",
"main": "lib/read.js",
"dependencies": {
- "mute-stream": "~0.0.2"
+ "mute-stream": "~0.0.4"
},
"devDependencies": {
"tap": "*"
"scripts": {
"test": "tap test/*.js"
},
- "readme": "## read\n\nFor reading user input from stdin.\n\nSimilar to the `readline` builtin's `question()` method, but with a\nfew more features.\n\n## USAGE\n\n```javascript\nvar read = require(\"read\")\nread(options, callback)\n```\n\nThe callback gets called with either the user input, or the default\nspecified, or an error, as `callback(error, result, isDefault)`\nnode style.\n\n## OPTIONS\n\nEvery option is optional.\n\n* `prompt` What to write to stdout before reading input.\n* `silent` Don't echo the output as the user types it.\n* `replace` Replace silenced characters with the supplied character value.\n* `timeout` Number of ms to wait for user input before giving up.\n* `default` The default value if the user enters nothing.\n* `edit` Allow the user to edit the default value.\n* `terminal` Treat the output as a TTY, whether it is or not.\n* `stdin` Readable stream to get input data from. (default `process.stdin`)\n* `stdout` Writeable stream to write prompts to. (default: `process.stdout`)\n\nIf silent is true, and the input is a TTY, then read will set raw\nmode, and read character by character.\n\n## COMPATIBILITY\n\nThis module works sort of with node 0.6. It does not work with node\nversions less than 0.6. It is best on node 0.8.\n\nOn node version 0.6, it will remove all listeners on the input\nstream's `data` and `keypress` events, because the readline module did\nnot fully clean up after itself in that version of node, and did not\nmake it possible to clean up after it in a way that has no potential\nfor side effects.\n\nAdditionally, some of the readline options (like `terminal`) will not\nfunction in versions of node before 0.8, because they were not\nimplemented in the builtin readline module.\n\n## CONTRIBUTING\n\nPatches welcome.\n",
- "_id": "read@1.0.4",
- "_from": "read@~1.0.3"
+ "readme": "## read\n\nFor reading user input from stdin.\n\nSimilar to the `readline` builtin's `question()` method, but with a\nfew more features.\n\n## USAGE\n\n```javascript\nvar read = require(\"read\")\nread(options, callback)\n```\n\nThe callback gets called with either the user input, or the default\nspecified, or an error, as `callback(error, result, isDefault)`\nnode style.\n\n## OPTIONS\n\nEvery option is optional.\n\n* `prompt` What to write to stdout before reading input.\n* `silent` Don't echo the output as the user types it.\n* `replace` Replace silenced characters with the supplied character value.\n* `timeout` Number of ms to wait for user input before giving up.\n* `default` The default value if the user enters nothing.\n* `edit` Allow the user to edit the default value.\n* `terminal` Treat the output as a TTY, whether it is or not.\n* `input` Readable stream to get input data from. (default `process.stdin`)\n* `output` Writeable stream to write prompts to. (default: `process.stdout`)\n\nIf silent is true, and the input is a TTY, then read will set raw\nmode, and read character by character.\n\n## COMPATIBILITY\n\nThis module works sort of with node 0.6. It does not work with node\nversions less than 0.6. It is best on node 0.8.\n\nOn node version 0.6, it will remove all listeners on the input\nstream's `data` and `keypress` events, because the readline module did\nnot fully clean up after itself in that version of node, and did not\nmake it possible to clean up after it in a way that has no potential\nfor side effects.\n\nAdditionally, some of the readline options (like `terminal`) will not\nfunction in versions of node before 0.8, because they were not\nimplemented in the builtin readline module.\n\n## CONTRIBUTING\n\nPatches welcome.\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/isaacs/read/issues"
+ },
+ "_id": "read@1.0.5",
+ "_from": "read@latest"
}
--- /dev/null
+var read = require('read');
+read({ silent: true, prompt: 'stars: ' }, function(er, data) {
+ console.log(er, data)
+})
pass: pass,
verify: pass2,
passMatch: (pass === pass2)}))
+ if (process.stdin.unref)
+ process.stdin.unref()
})
})
})
pass: pass,
verify: pass2,
passMatch: (pass === pass2)}))
+ if (process.stdin.unref)
+ process.stdin.unref()
})
})
})
read({prompt:'18'}, function (er, r18) {if (er) throw er
console.log(r1, r2, r3, r4, r5, r6, r7, r8, r9, r10,
r11, r12, r13, r14, r15, r16, r17, r18)
+ if (process.stdin.unref)
+ process.stdin.unref()
})})})})})})})})})})})})})})})})})})
}
{
"name": "rimraf",
- "version": "2.2.0",
+ "version": "2.2.2",
"main": "rimraf.js",
"description": "A deep deletion module for node (like `rm -rf`)",
"author": {
"url": "https://github.com/isaacs/rimraf/raw/master/LICENSE"
},
"optionalDependencies": {
- "graceful-fs": "~1"
+ "graceful-fs": "~2"
},
"repository": {
"type": "git",
"url": "https://github.com/isaacs/rimraf/issues"
},
"dependencies": {
- "graceful-fs": "~1"
+ "graceful-fs": "~2"
},
- "_id": "rimraf@2.2.0",
- "_from": "rimraf@2.2"
+ "_id": "rimraf@2.2.2",
+ "dist": {
+ "shasum": "d99ec41dc646e55bf7a7a44a255c28bef33a8abf"
+ },
+ "_from": "rimraf@2.2.2",
+ "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.2.tgz"
}
exports.EMFILE_MAX = 1000
exports.BUSYTRIES_MAX = 3
+var isWindows = (process.platform === "win32")
+
function rimraf (p, cb) {
if (!cb) throw new Error("No callback passed to rimraf()")
// be made configurable somehow. But until then, YAGNI.
function rimraf_ (p, cb) {
fs.unlink(p, function (er) {
- if (er && er.code === "ENOENT")
- return cb()
- if (er && (er.code === "EPERM" || er.code === "EISDIR"))
- return rmdir(p, er, cb)
+ if (er) {
+ if (er.code === "ENOENT")
+ return cb()
+ if (er.code === "EPERM")
+ return (isWindows) ? fixWinEPERM(p, er, cb) : rmdir(p, er, cb)
+ if (er.code === "EISDIR")
+ return rmdir(p, er, cb)
+ }
return cb(er)
})
}
+function fixWinEPERM (p, er, cb) {
+ fs.chmod(p, 666, function (er2) {
+ if (er2)
+ cb(er2.code === "ENOENT" ? null : er)
+ else
+ fs.stat(p, function(er3, stats) {
+ if (er3)
+ cb(er3.code === "ENOENT" ? null : er)
+ else if (stats.isDirectory())
+ rmdir(p, er, cb)
+ else
+ fs.unlink(p, cb)
+ })
+ })
+}
+
+function fixWinEPERMSync (p, er, cb) {
+ try {
+ fs.chmodSync(p, 666)
+ } catch (er2) {
+ if (er2.code !== "ENOENT")
+ throw er
+ }
+
+ try {
+ var stats = fs.statSync(p)
+ } catch (er3) {
+ if (er3 !== "ENOENT")
+ throw er
+ }
+
+ if (stats.isDirectory())
+ rmdirSync(p, er)
+ else
+ fs.unlinkSync(p)
+}
+
function rmdir (p, originalEr, cb) {
// try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
// if we guessed wrong, and it's not a directory, then
} catch (er) {
if (er.code === "ENOENT")
return
- if (er.code !== "EPERM" && er.code !== "EISDIR")
+ if (er.code === "EPERM")
+ return isWindows ? fixWinEPERMSync(p, er) : rmdirSync(p, er)
+ if (er.code !== "EISDIR")
throw er
- try {
- fs.rmdirSync(p)
- } catch (er2) {
- if (er2.code === "ENOENT")
- return
- if (er2.code === "ENOTDIR")
- throw er
- if (er2.code === "ENOTEMPTY") {
- fs.readdirSync(p).forEach(function (f) {
- rimrafSync(path.join(p, f))
- })
- fs.rmdirSync(p)
- }
- }
+ rmdirSync(p, er)
}
}
+
+function rmdirSync (p, originalEr) {
+ try {
+ fs.rmdirSync(p)
+ } catch (er) {
+ if (er.code === "ENOENT")
+ return
+ if (er.code === "ENOTDIR")
+ throw originalEr
+ if (er.code === "ENOTEMPTY" || er.code === "EEXIST")
+ rmkidsSync(p)
+ }
+}
+
+function rmkidsSync (p) {
+ fs.readdirSync(p).forEach(function (f) {
+ rimrafSync(path.join(p, f))
+ })
+ fs.rmdirSync(p)
+}
$ semver -h
- Usage: semver -v <version> [-r <range>]
- Test if version(s) satisfy the supplied range(s),
- and sort them.
+ Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | -d <dec>]
+ Test if version(s) satisfy the supplied range(s), and sort them.
- Multiple versions or ranges may be supplied.
+ Multiple versions or ranges may be supplied, unless increment
+ or decrement options are specified. In that case, only a single
+ version may be used, and it is incremented by the specified level
Program exits successfully if any valid version satisfies
all supplied ranges, and prints all satisfying versions.
* valid(v): Return the parsed version, or null if it's not valid.
* inc(v, release): Return the version incremented by the release type
- (major, minor, patch, or build), or null if it's not valid.
+ (major, minor, patch, or prerelease), or null if it's not valid.
### Comparison
, gt = []
, lt = []
, eq = []
+ , inc = null
+ , version = require("../package.json").version
+ , loose = false
, semver = require("../semver")
main()
function main () {
if (!argv.length) return help()
while (argv.length) {
- var a
- switch (a = argv.shift()) {
+ var a = argv.shift()
+ var i = a.indexOf('=')
+ if (i !== -1) {
+ a = a.slice(0, i)
+ argv.unshift(a.slice(i + 1))
+ }
+ switch (a) {
+ case "-l": case "--loose":
+ loose = true
+ break
case "-v": case "--version":
versions.push(argv.shift())
break
+ case "-i": case "--inc": case "--increment":
+ switch (argv[0]) {
+ case "major": case "minor": case "patch": case "prerelease":
+ inc = argv.shift()
+ break
+ default:
+ inc = "patch"
+ break
+ }
+ break
case "-r": case "--range":
range.push(argv.shift())
break
}
}
- versions = versions.filter(semver.valid)
+ versions = versions.filter(function (v) {
+ return semver.valid(v, loose)
+ })
if (!versions.length) return fail()
+ if (inc && (versions.length !== 1 || range.length))
+ return failInc()
+
for (var i = 0, l = range.length; i < l ; i ++) {
versions = versions.filter(function (v) {
- return semver.satisfies(v, range[i])
+ return semver.satisfies(v, range[i], loose)
})
if (!versions.length) return fail()
}
return success(versions)
}
+function failInc () {
+ console.error("--inc can only be used on a single version with no range")
+ fail()
+}
+
function fail () { process.exit(1) }
function success () {
- versions.sort(semver.compare)
- .map(semver.clean)
- .forEach(function (v,i,_) { console.log(v) })
+ versions.sort(function (a, b) {
+ return semver.compare(a, b, loose)
+ }).map(function (v) {
+ return semver.clean(v, loose)
+ }).map(function (v) {
+ return inc ? semver.inc(v, inc, loose) : v
+ }).forEach(function (v,i,_) { console.log(v) })
}
function help () {
- console.log(["Usage: semver -v <version> [-r <range>]"
- ,"Test if version(s) satisfy the supplied range(s),"
- ,"and sort them."
+ console.log(["SemVer " + version
,""
- ,"Multiple versions or ranges may be supplied."
+ ,"A JavaScript implementation of the http://semver.org/ specification"
+ ,"Copyright Isaac Z. Schlueter"
+ ,""
+ ,"Usage: semver [options] <version> [<version> [...]]"
+ ,"Prints valid versions sorted by SemVer precedence"
+ ,""
+ ,"Options:"
+ ,"-r --range <range>"
+ ," Print versions that match the specified range."
+ ,""
+ ,"-i --increment [<level>]"
+ ," Increment a version by the specified level. Level can"
+ ," be one of: major, minor, patch, or prerelease"
+ ," Default level is 'patch'."
+ ," Only one version may be specified."
+ ,""
+ ,"-l --loose"
+ ," Interpret versions and ranges loosely"
,""
,"Program exits successfully if any valid version satisfies"
,"all supplied ranges, and prints all satisfying versions."
,""
- ,"If no versions are valid, or ranges are not satisfied,"
- ,"then exits failure."
+ ,"If no satisfying versions are found, then exits failure."
,""
,"Versions are printed in ascending order, so supplying"
,"multiple versions to the utility will just sort them."
].join("\n"))
}
-
-
{
"name": "semver",
- "version": "2.0.8",
+ "version": "2.0.11",
"description": "The semantic version parser used by npm.",
"main": "semver.js",
"browser": "semver.browser.js",
"bin": {
"semver": "./bin/semver"
},
- "readme": "semver(1) -- The semantic versioner for npm\n===========================================\n\n## Usage\n\n $ npm install semver\n\n semver.valid('1.2.3') // '1.2.3'\n semver.valid('a.b.c') // null\n semver.clean(' =v1.2.3 ') // '1.2.3'\n semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true\n semver.gt('1.2.3', '9.8.7') // false\n semver.lt('1.2.3', '9.8.7') // true\n\nAs a command-line utility:\n\n $ semver -h\n\n Usage: semver -v <version> [-r <range>]\n Test if version(s) satisfy the supplied range(s),\n and sort them.\n\n Multiple versions or ranges may be supplied.\n\n Program exits successfully if any valid version satisfies\n all supplied ranges, and prints all satisfying versions.\n\n If no versions are valid, or ranges are not satisfied,\n then exits failure.\n\n Versions are printed in ascending order, so supplying\n multiple versions to the utility will just sort them.\n\n## Versions\n\nA \"version\" is described by the v2.0.0 specification found at\n<http://semver.org/>.\n\nA leading `\"=\"` or `\"v\"` character is stripped off and ignored.\n\n## Ranges\n\nThe following range styles are supported:\n\n* `1.2.3` A specific version. When nothing else will do. Note that\n build metadata is still ignored, so `1.2.3+build2012` will satisfy\n this range.\n* `>1.2.3` Greater than a specific version.\n* `<1.2.3` Less than a specific version. If there is no prerelease\n tag on the version range, then no prerelease version will be allowed\n either, even though these are technically \"less than\".\n* `>=1.2.3` Greater than or equal to. Note that prerelease versions\n are NOT equal to their \"normal\" equivalents, so `1.2.3-beta` will\n not satisfy this range, but `2.3.0-beta` will.\n* `<=1.2.3` Less than or equal to. In this case, prerelease versions\n ARE allowed, so `1.2.3-beta` would satisfy.\n* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`\n* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` \"Reasonably close to 1.2.3\". When\n using tilde operators, prerelease versions are supported as well,\n but a prerelease of the next significant digit will NOT be\n satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`.\n* `~1.2` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with 1.2\"\n* `1.2.x` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with 1.2\"\n* `~1` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with 1\"\n* `1.x` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with 1\"\n\n\nRanges can be joined with either a space (which implies \"and\") or a\n`||` (which implies \"or\").\n\n## Functions\n\nAll methods and classes take a final `loose` boolean argument that, if\ntrue, will be more forgiving about not-quite-valid semver strings.\nThe resulting output will always be 100% strict, of course.\n\nStrict-mode Comparators and Ranges will be strict about the SemVer\nstrings that they parse.\n\n* valid(v): Return the parsed version, or null if it's not valid.\n* inc(v, release): Return the version incremented by the release type\n (major, minor, patch, or build), or null if it's not valid.\n\n### Comparison\n\n* gt(v1, v2): `v1 > v2`\n* gte(v1, v2): `v1 >= v2`\n* lt(v1, v2): `v1 < v2`\n* lte(v1, v2): `v1 <= v2`\n* eq(v1, v2): `v1 == v2` This is true if they're logically equivalent,\n even if they're not the exact same string. You already know how to\n compare strings.\n* neq(v1, v2): `v1 != v2` The opposite of eq.\n* cmp(v1, comparator, v2): Pass in a comparison string, and it'll call\n the corresponding function above. `\"===\"` and `\"!==\"` do simple\n string comparison, but are included for completeness. Throws if an\n invalid comparison string is provided.\n* compare(v1, v2): Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if\n v2 is greater. Sorts in ascending order if passed to Array.sort().\n* rcompare(v1, v2): The reverse of compare. Sorts an array of versions\n in descending order when passed to Array.sort().\n\n\n### Ranges\n\n* validRange(range): Return the valid range or null if it's not valid\n* satisfies(version, range): Return true if the version satisfies the\n range.\n* maxSatisfying(versions, range): Return the highest version in the list\n that satisfies the range, or null if none of them do.\n",
+ "readme": "semver(1) -- The semantic versioner for npm\n===========================================\n\n## Usage\n\n $ npm install semver\n\n semver.valid('1.2.3') // '1.2.3'\n semver.valid('a.b.c') // null\n semver.clean(' =v1.2.3 ') // '1.2.3'\n semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true\n semver.gt('1.2.3', '9.8.7') // false\n semver.lt('1.2.3', '9.8.7') // true\n\nAs a command-line utility:\n\n $ semver -h\n\n Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | -d <dec>]\n Test if version(s) satisfy the supplied range(s), and sort them.\n\n Multiple versions or ranges may be supplied, unless increment\n or decrement options are specified. In that case, only a single\n version may be used, and it is incremented by the specified level\n\n Program exits successfully if any valid version satisfies\n all supplied ranges, and prints all satisfying versions.\n\n If no versions are valid, or ranges are not satisfied,\n then exits failure.\n\n Versions are printed in ascending order, so supplying\n multiple versions to the utility will just sort them.\n\n## Versions\n\nA \"version\" is described by the v2.0.0 specification found at\n<http://semver.org/>.\n\nA leading `\"=\"` or `\"v\"` character is stripped off and ignored.\n\n## Ranges\n\nThe following range styles are supported:\n\n* `1.2.3` A specific version. When nothing else will do. Note that\n build metadata is still ignored, so `1.2.3+build2012` will satisfy\n this range.\n* `>1.2.3` Greater than a specific version.\n* `<1.2.3` Less than a specific version. If there is no prerelease\n tag on the version range, then no prerelease version will be allowed\n either, even though these are technically \"less than\".\n* `>=1.2.3` Greater than or equal to. Note that prerelease versions\n are NOT equal to their \"normal\" equivalents, so `1.2.3-beta` will\n not satisfy this range, but `2.3.0-beta` will.\n* `<=1.2.3` Less than or equal to. In this case, prerelease versions\n ARE allowed, so `1.2.3-beta` would satisfy.\n* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`\n* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` \"Reasonably close to 1.2.3\". When\n using tilde operators, prerelease versions are supported as well,\n but a prerelease of the next significant digit will NOT be\n satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`.\n* `~1.2` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with 1.2\"\n* `1.2.x` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with 1.2\"\n* `~1` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with 1\"\n* `1.x` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with 1\"\n\n\nRanges can be joined with either a space (which implies \"and\") or a\n`||` (which implies \"or\").\n\n## Functions\n\nAll methods and classes take a final `loose` boolean argument that, if\ntrue, will be more forgiving about not-quite-valid semver strings.\nThe resulting output will always be 100% strict, of course.\n\nStrict-mode Comparators and Ranges will be strict about the SemVer\nstrings that they parse.\n\n* valid(v): Return the parsed version, or null if it's not valid.\n* inc(v, release): Return the version incremented by the release type\n (major, minor, patch, or prerelease), or null if it's not valid.\n\n### Comparison\n\n* gt(v1, v2): `v1 > v2`\n* gte(v1, v2): `v1 >= v2`\n* lt(v1, v2): `v1 < v2`\n* lte(v1, v2): `v1 <= v2`\n* eq(v1, v2): `v1 == v2` This is true if they're logically equivalent,\n even if they're not the exact same string. You already know how to\n compare strings.\n* neq(v1, v2): `v1 != v2` The opposite of eq.\n* cmp(v1, comparator, v2): Pass in a comparison string, and it'll call\n the corresponding function above. `\"===\"` and `\"!==\"` do simple\n string comparison, but are included for completeness. Throws if an\n invalid comparison string is provided.\n* compare(v1, v2): Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if\n v2 is greater. Sorts in ascending order if passed to Array.sort().\n* rcompare(v1, v2): The reverse of compare. Sorts an array of versions\n in descending order when passed to Array.sort().\n\n\n### Ranges\n\n* validRange(range): Return the valid range or null if it's not valid\n* satisfies(version, range): Return true if the version satisfies the\n range.\n* maxSatisfying(versions, range): Return the highest version in the list\n that satisfies the range, or null if none of them do.\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/node-semver/issues"
},
- "_id": "semver@2.0.8",
+ "_id": "semver@2.0.11",
"_from": "semver@latest"
}
--- /dev/null
+var semver = require('./')
+var r = new semver.Range('git+https://user:password0123@github.com/foo/bar.git', true)
+r.inspect = null
+console.log(r)
src[LONETILDE] = '(?:~>?)';
var TILDETRIM = R++;
-src[TILDETRIM] = src[LONETILDE] + '\s+';
-var tildeTrimReplace = '$1';
+src[TILDETRIM] = src[LONETILDE] + '\\s+';
+var tildeTrimReplace = '~';
var TILDE = R++;
src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$';
// An expression to strip any whitespace between the gtlt and the thing
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
var COMPARATORTRIM = R++;
-src[COMPARATORTRIM] = src[GTLT] +
+src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
'\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')';
// this one has to use the /g flag
re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g');
-
-var comparatorTrimReplace = '$1$2 ';
+var comparatorTrimReplace = '$1$2$3';
// Something like `1.2.3 - 1.2.4`
function maxSatisfying(versions, range, loose) {
return versions.filter(function(version) {
return satisfies(version, range, loose);
- }).sort(rcompare)[0] || null;
+ }).sort(function(a, b) {
+ return rcompare(a, b, loose);
+ })[0] || null;
}
exports.validRange = validRange;
src[LONETILDE] = '(?:~>?)';
var TILDETRIM = R++;
-src[TILDETRIM] = src[LONETILDE] + '\s+';
-var tildeTrimReplace = '$1';
+src[TILDETRIM] = src[LONETILDE] + '\\s+';
+var tildeTrimReplace = '~';
var TILDE = R++;
src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$';
// An expression to strip any whitespace between the gtlt and the thing
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
var COMPARATORTRIM = R++;
-src[COMPARATORTRIM] = src[GTLT] +
+src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
'\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')';
// this one has to use the /g flag
re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g');
-
-var comparatorTrimReplace = '$1$2 ';
+var comparatorTrimReplace = '$1$2$3';
// Something like `1.2.3 - 1.2.4`
debug('hyphen replace', range);
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace);
- debug('comparator trim', range);
+ debug('comparator trim', range, re[COMPARATORTRIM]);
// `~ 1.2.3` => `~1.2.3`
range = range.replace(re[TILDETRIM], tildeTrimReplace);
function maxSatisfying(versions, range, loose) {
return versions.filter(function(version) {
return satisfies(version, range, loose);
- }).sort(rcompare)[0] || null;
+ }).sort(function(a, b) {
+ return rcompare(a, b, loose);
+ })[0] || null;
}
exports.validRange = validRange;
-!function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=O;e.SEMVER_SPEC_VERSION="2.0.0";var r=e.re=[];var t=e.src=[];var n=0;var i=n++;t[i]="0|[1-9]\\d*";var s=n++;t[s]="[0-9]+";var o=n++;t[o]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var a=n++;t[a]="("+t[i]+")\\."+"("+t[i]+")\\."+"("+t[i]+")";var u=n++;t[u]="("+t[s]+")\\."+"("+t[s]+")\\."+"("+t[s]+")";var f=n++;t[f]="(?:"+t[i]+"|"+t[o]+")";var c=n++;t[c]="(?:"+t[s]+"|"+t[o]+")";var l=n++;t[l]="(?:-("+t[f]+"(?:\\."+t[f]+")*))";var p=n++;t[p]="(?:-?("+t[c]+"(?:\\."+t[c]+")*))";var h=n++;t[h]="[0-9A-Za-z-]+";var v=n++;t[v]="(?:\\+("+t[h]+"(?:\\."+t[h]+")*))";var m=n++;var g="v?"+t[a]+t[l]+"?"+t[v]+"?";t[m]="^"+g+"$";var d="[v=\\s]*"+t[u]+t[p]+"?"+t[v]+"?";var w=n++;t[w]="^"+d+"$";var y=n++;t[y]="((?:<|>)?=?)";var $=n++;t[$]=t[s]+"|x|X|\\*";var j=n++;t[j]=t[i]+"|x|X|\\*";var b=n++;t[b]="[v=\\s]*("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:("+t[l]+")"+")?)?)?";var S=n++;t[S]="[v=\\s]*("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:("+t[p]+")"+")?)?)?";var E=n++;t[E]="^"+t[y]+"\\s*"+t[b]+"$";var k=n++;t[k]="^"+t[y]+"\\s*"+t[S]+"$";var x=n++;t[x]="(?:~>?)";var R=n++;t[R]=t[x]+"s+";var V="$1";var I=n++;t[I]="^"+t[x]+t[b]+"$";var C=n++;t[C]="^"+t[x]+t[S]+"$";var A=n++;t[A]="^"+t[y]+"\\s*("+d+")$|^$";var T=n++;t[T]="^"+t[y]+"\\s*("+g+")$|^$";var z=n++;t[z]=t[y]+"\\s*("+d+"|"+t[b]+")";r[z]=new RegExp(t[z],"g");var M="$1$2 ";var P=n++;t[P]="^\\s*("+t[b]+")"+"\\s+-\\s+"+"("+t[b]+")"+"\\s*$";var Z=n++;t[Z]="^\\s*("+t[S]+")"+"\\s+-\\s+"+"("+t[S]+")"+"\\s*$";var q=n++;t[q]="(<|>)?=?\\s*\\*";for(var L=0;L<n;L++){if(!r[L])r[L]=new RegExp(t[L])}e.parse=X;function X(e,t){var n=t?r[w]:r[m];return n.test(e)?new O(e,t):null}e.valid=_;function _(e,r){var t=X(e,r);return t?t.version:null}e.clean=N;function N(e,r){var t=X(e,r);return t?t.version:null}e.SemVer=O;function O(e,t){if(e instanceof O){if(e.loose===t)return e;else e=e.version}if(!(this instanceof O))return new O(e,t);this.loose=t;var n=e.trim().match(t?r[w]:r[m]);if(!n)throw new TypeError("Invalid Version: "+e);this.raw=e;this.major=+n[1];this.minor=+n[2];this.patch=+n[3];if(!n[4])this.prerelease=[];else this.prerelease=n[4].split(".").map(function(e){return/^[0-9]+$/.test(e)?+e:e});this.build=n[5]?n[5].split("."):[];this.format()}O.prototype.format=function(){this.version=this.major+"."+this.minor+"."+this.patch;if(this.prerelease.length)this.version+="-"+this.prerelease.join(".");return this.version};O.prototype.inspect=function(){return'<SemVer "'+this+'">'};O.prototype.toString=function(){return this.version};O.prototype.compare=function(e){if(!(e instanceof O))e=new O(e,this.loose);return this.compareMain(e)||this.comparePre(e)};O.prototype.compareMain=function(e){if(!(e instanceof O))e=new O(e,this.loose);return F(this.major,e.major)||F(this.minor,e.minor)||F(this.patch,e.patch)};O.prototype.comparePre=function(e){if(!(e instanceof O))e=new O(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.lenth&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return F(t,n)}while(++r)};O.prototype.inc=function(e){switch(e){case"major":this.major++;this.minor=-1;case"minor":this.minor++;this.patch=-1;case"patch":this.patch++;this.prerelease=[];break;case"prerelease":if(this.prerelease.length===0)this.prerelease=[0];else{var r=this.prerelease.length;while(--r>=0){if(typeof this.prerelease[r]==="number"){this.prerelease[r]++;r=-2}}if(r===-1)this.prerelease.push(0)}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=B;function B(e,r,t){try{return new O(e,t).inc(r).version}catch(n){return null}}e.compareIdentifiers=F;var D=/^[0-9]+$/;function F(e,r){var t=D.test(e);var n=D.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:e<r?-1:e>r?1:0}e.rcompareIdentifiers=G;function G(e,r){return F(r,e)}e.compare=H;function H(e,r,t){return new O(e,t).compare(r)}e.compareLoose=J;function J(e,r){return H(e,r,true)}e.rcompare=K;function K(e,r,t){return H(r,e,t)}e.sort=Q;function Q(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=U;function U(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=W;function W(e,r,t){return H(e,r,t)>0}e.lt=Y;function Y(e,r,t){return H(e,r,t)<0}e.eq=er;function er(e,r,t){return H(e,r,t)===0}e.neq=rr;function rr(e,r,t){return H(e,r,t)!==0}e.gte=tr;function tr(e,r,t){return H(e,r,t)>=0}e.lte=nr;function nr(e,r,t){return H(e,r,t)<=0}e.cmp=ir;function ir(e,r,t,n){var i;switch(r){case"===":i=e===t;break;case"!==":i=e!==t;break;case"":case"=":case"==":i=er(e,t,n);break;case"!=":i=rr(e,t,n);break;case">":i=W(e,t,n);break;case">=":i=tr(e,t,n);break;case"<":i=Y(e,t,n);break;case"<=":i=nr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=sr;function sr(e,r){if(e instanceof sr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof sr))return new sr(e,r);this.loose=r;this.parse(e);if(this.semver===or)this.value="";else this.value=this.operator+this.semver.version}var or={};sr.prototype.parse=function(e){var t=this.loose?r[A]:r[T];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(!n[2])this.semver=or;else{this.semver=new O(n[2],this.loose);if(this.operator==="<"&&!this.semver.prerelease.length){this.semver.prerelease=["0"];this.semver.format()}}};sr.prototype.inspect=function(){return'<SemVer Comparator "'+this+'">'};sr.prototype.toString=function(){return this.value};sr.prototype.test=function(e){return this.semver===or?true:ir(e,this.operator,this.semver,this.loose)};e.Range=ar;function ar(e,r){if(e instanceof ar&&e.loose===r)return e;if(!(this instanceof ar))return new ar(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}ar.prototype.inspect=function(){return'<SemVer Range "'+this.range+'">'};ar.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};ar.prototype.toString=function(){return this.range};ar.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[Z]:r[P];e=e.replace(n,gr);e=e.replace(r[z],M);e=e.replace(r[R],V);e=e.split(/\s+/).join(" ");var i=t?r[A]:r[T];var s=e.split(" ").map(function(e){return fr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new sr(e,t)});return s};e.toComparators=ur;function ur(e,r){return new ar(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function fr(e,r){e=lr(e,r);e=hr(e,r);e=mr(e,r);return e}function cr(e){return!e||e.toLowerCase()==="x"||e==="*"}function lr(e,r){return e.trim().split(/\s+/).map(function(e){return pr(e,r)}).join(" ")}function pr(e,t){var n=t?r[C]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(cr(r))s="";else if(cr(t))s=">="+r+".0.0-0 <"+(+r+1)+".0.0-0";else if(cr(n))s=">="+r+"."+t+".0-0 <"+r+"."+(+t+1)+".0-0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0-0"}else s=">="+r+"."+t+"."+n+"-0"+" <"+r+"."+(+t+1)+".0-0";return s})}function hr(e,r){return e.split(/\s+/).map(function(e){return vr(e,r)}).join(" ")}function vr(e,t){e=e.trim();var n=t?r[k]:r[E];return e.replace(n,function(e,r,t,n,i,s){var o=cr(t);var a=o||cr(n);var u=a||cr(i);var f=u;if(r==="="&&f)r="";if(r&&f){if(o)t=0;if(a)n=0;if(u)i=0;if(r===">"){r=">=";if(o){}else if(a){t=+t+1;n=0;i=0}else if(u){n=+n+1;i=0}}e=r+t+"."+n+"."+i+"-0"}else if(o){e="*"}else if(a){e=">="+t+".0.0-0 <"+(+t+1)+".0.0-0"}else if(u){e=">="+t+"."+n+".0-0 <"+t+"."+(+n+1)+".0-0"}return e})}function mr(e,t){return e.trim().replace(r[q],"")}function gr(e,r,t,n,i,s,o,a,u,f,c,l,p){if(cr(t))r="";else if(cr(n))r=">="+t+".0.0-0";else if(cr(i))r=">="+t+"."+n+".0-0";else r=">="+r;if(cr(u))a="";else if(cr(f))a="<"+(+u+1)+".0.0-0";else if(cr(c))a="<"+u+"."+(+f+1)+".0-0";else if(l)a="<="+u+"."+f+"."+c+"-"+l;else a="<="+a;return(r+" "+a).trim()}ar.prototype.test=function(e){if(!e)return false;for(var r=0;r<this.set.length;r++){if(dr(this.set[r],e))return true}return false};function dr(e,r){for(var t=0;t<e.length;t++){if(!e[t].test(r))return false}return true}e.satisfies=wr;function wr(e,r,t){try{r=new ar(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=yr;function yr(e,r,t){return e.filter(function(e){return wr(e,r,t)}).sort(K)[0]||null}e.validRange=$r;function $r(e,r){try{return new ar(e,r).range||"*"}catch(t){return null}}if(typeof define==="function"&&define.amd)define(e)}(typeof exports==="object"?exports:typeof define==="function"&&define.amd?{}:semver={});
\ No newline at end of file
+!function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=O;e.SEMVER_SPEC_VERSION="2.0.0";var r=e.re=[];var t=e.src=[];var n=0;var i=n++;t[i]="0|[1-9]\\d*";var s=n++;t[s]="[0-9]+";var o=n++;t[o]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var a=n++;t[a]="("+t[i]+")\\."+"("+t[i]+")\\."+"("+t[i]+")";var u=n++;t[u]="("+t[s]+")\\."+"("+t[s]+")\\."+"("+t[s]+")";var f=n++;t[f]="(?:"+t[i]+"|"+t[o]+")";var c=n++;t[c]="(?:"+t[s]+"|"+t[o]+")";var l=n++;t[l]="(?:-("+t[f]+"(?:\\."+t[f]+")*))";var p=n++;t[p]="(?:-?("+t[c]+"(?:\\."+t[c]+")*))";var h=n++;t[h]="[0-9A-Za-z-]+";var v=n++;t[v]="(?:\\+("+t[h]+"(?:\\."+t[h]+")*))";var m=n++;var g="v?"+t[a]+t[l]+"?"+t[v]+"?";t[m]="^"+g+"$";var d="[v=\\s]*"+t[u]+t[p]+"?"+t[v]+"?";var w=n++;t[w]="^"+d+"$";var y=n++;t[y]="((?:<|>)?=?)";var $=n++;t[$]=t[s]+"|x|X|\\*";var j=n++;t[j]=t[i]+"|x|X|\\*";var b=n++;t[b]="[v=\\s]*("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:("+t[l]+")"+")?)?)?";var S=n++;t[S]="[v=\\s]*("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:("+t[p]+")"+")?)?)?";var E=n++;t[E]="^"+t[y]+"\\s*"+t[b]+"$";var k=n++;t[k]="^"+t[y]+"\\s*"+t[S]+"$";var x=n++;t[x]="(?:~>?)";var R=n++;t[R]=t[x]+"\\s+";var V="~";var I=n++;t[I]="^"+t[x]+t[b]+"$";var C=n++;t[C]="^"+t[x]+t[S]+"$";var A=n++;t[A]="^"+t[y]+"\\s*("+d+")$|^$";var T=n++;t[T]="^"+t[y]+"\\s*("+g+")$|^$";var z=n++;t[z]="(\\s*)"+t[y]+"\\s*("+d+"|"+t[b]+")";r[z]=new RegExp(t[z],"g");var M="$1$2$3";var P=n++;t[P]="^\\s*("+t[b]+")"+"\\s+-\\s+"+"("+t[b]+")"+"\\s*$";var Z=n++;t[Z]="^\\s*("+t[S]+")"+"\\s+-\\s+"+"("+t[S]+")"+"\\s*$";var q=n++;t[q]="(<|>)?=?\\s*\\*";for(var L=0;L<n;L++){if(!r[L])r[L]=new RegExp(t[L])}e.parse=X;function X(e,t){var n=t?r[w]:r[m];return n.test(e)?new O(e,t):null}e.valid=_;function _(e,r){var t=X(e,r);return t?t.version:null}e.clean=N;function N(e,r){var t=X(e,r);return t?t.version:null}e.SemVer=O;function O(e,t){if(e instanceof O){if(e.loose===t)return e;else e=e.version}if(!(this instanceof O))return new O(e,t);this.loose=t;var n=e.trim().match(t?r[w]:r[m]);if(!n)throw new TypeError("Invalid Version: "+e);this.raw=e;this.major=+n[1];this.minor=+n[2];this.patch=+n[3];if(!n[4])this.prerelease=[];else this.prerelease=n[4].split(".").map(function(e){return/^[0-9]+$/.test(e)?+e:e});this.build=n[5]?n[5].split("."):[];this.format()}O.prototype.format=function(){this.version=this.major+"."+this.minor+"."+this.patch;if(this.prerelease.length)this.version+="-"+this.prerelease.join(".");return this.version};O.prototype.inspect=function(){return'<SemVer "'+this+'">'};O.prototype.toString=function(){return this.version};O.prototype.compare=function(e){if(!(e instanceof O))e=new O(e,this.loose);return this.compareMain(e)||this.comparePre(e)};O.prototype.compareMain=function(e){if(!(e instanceof O))e=new O(e,this.loose);return F(this.major,e.major)||F(this.minor,e.minor)||F(this.patch,e.patch)};O.prototype.comparePre=function(e){if(!(e instanceof O))e=new O(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.lenth&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return F(t,n)}while(++r)};O.prototype.inc=function(e){switch(e){case"major":this.major++;this.minor=-1;case"minor":this.minor++;this.patch=-1;case"patch":this.patch++;this.prerelease=[];break;case"prerelease":if(this.prerelease.length===0)this.prerelease=[0];else{var r=this.prerelease.length;while(--r>=0){if(typeof this.prerelease[r]==="number"){this.prerelease[r]++;r=-2}}if(r===-1)this.prerelease.push(0)}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=B;function B(e,r,t){try{return new O(e,t).inc(r).version}catch(n){return null}}e.compareIdentifiers=F;var D=/^[0-9]+$/;function F(e,r){var t=D.test(e);var n=D.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:e<r?-1:e>r?1:0}e.rcompareIdentifiers=G;function G(e,r){return F(r,e)}e.compare=H;function H(e,r,t){return new O(e,t).compare(r)}e.compareLoose=J;function J(e,r){return H(e,r,true)}e.rcompare=K;function K(e,r,t){return H(r,e,t)}e.sort=Q;function Q(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=U;function U(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=W;function W(e,r,t){return H(e,r,t)>0}e.lt=Y;function Y(e,r,t){return H(e,r,t)<0}e.eq=er;function er(e,r,t){return H(e,r,t)===0}e.neq=rr;function rr(e,r,t){return H(e,r,t)!==0}e.gte=tr;function tr(e,r,t){return H(e,r,t)>=0}e.lte=nr;function nr(e,r,t){return H(e,r,t)<=0}e.cmp=ir;function ir(e,r,t,n){var i;switch(r){case"===":i=e===t;break;case"!==":i=e!==t;break;case"":case"=":case"==":i=er(e,t,n);break;case"!=":i=rr(e,t,n);break;case">":i=W(e,t,n);break;case">=":i=tr(e,t,n);break;case"<":i=Y(e,t,n);break;case"<=":i=nr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=sr;function sr(e,r){if(e instanceof sr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof sr))return new sr(e,r);this.loose=r;this.parse(e);if(this.semver===or)this.value="";else this.value=this.operator+this.semver.version}var or={};sr.prototype.parse=function(e){var t=this.loose?r[A]:r[T];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(!n[2])this.semver=or;else{this.semver=new O(n[2],this.loose);if(this.operator==="<"&&!this.semver.prerelease.length){this.semver.prerelease=["0"];this.semver.format()}}};sr.prototype.inspect=function(){return'<SemVer Comparator "'+this+'">'};sr.prototype.toString=function(){return this.value};sr.prototype.test=function(e){return this.semver===or?true:ir(e,this.operator,this.semver,this.loose)};e.Range=ar;function ar(e,r){if(e instanceof ar&&e.loose===r)return e;if(!(this instanceof ar))return new ar(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}ar.prototype.inspect=function(){return'<SemVer Range "'+this.range+'">'};ar.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};ar.prototype.toString=function(){return this.range};ar.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[Z]:r[P];e=e.replace(n,gr);e=e.replace(r[z],M);e=e.replace(r[R],V);e=e.split(/\s+/).join(" ");var i=t?r[A]:r[T];var s=e.split(" ").map(function(e){return fr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new sr(e,t)});return s};e.toComparators=ur;function ur(e,r){return new ar(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function fr(e,r){e=lr(e,r);e=hr(e,r);e=mr(e,r);return e}function cr(e){return!e||e.toLowerCase()==="x"||e==="*"}function lr(e,r){return e.trim().split(/\s+/).map(function(e){return pr(e,r)}).join(" ")}function pr(e,t){var n=t?r[C]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(cr(r))s="";else if(cr(t))s=">="+r+".0.0-0 <"+(+r+1)+".0.0-0";else if(cr(n))s=">="+r+"."+t+".0-0 <"+r+"."+(+t+1)+".0-0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0-0"}else s=">="+r+"."+t+"."+n+"-0"+" <"+r+"."+(+t+1)+".0-0";return s})}function hr(e,r){return e.split(/\s+/).map(function(e){return vr(e,r)}).join(" ")}function vr(e,t){e=e.trim();var n=t?r[k]:r[E];return e.replace(n,function(e,r,t,n,i,s){var o=cr(t);var a=o||cr(n);var u=a||cr(i);var f=u;if(r==="="&&f)r="";if(r&&f){if(o)t=0;if(a)n=0;if(u)i=0;if(r===">"){r=">=";if(o){}else if(a){t=+t+1;n=0;i=0}else if(u){n=+n+1;i=0}}e=r+t+"."+n+"."+i+"-0"}else if(o){e="*"}else if(a){e=">="+t+".0.0-0 <"+(+t+1)+".0.0-0"}else if(u){e=">="+t+"."+n+".0-0 <"+t+"."+(+n+1)+".0-0"}return e})}function mr(e,t){return e.trim().replace(r[q],"")}function gr(e,r,t,n,i,s,o,a,u,f,c,l,p){if(cr(t))r="";else if(cr(n))r=">="+t+".0.0-0";else if(cr(i))r=">="+t+"."+n+".0-0";else r=">="+r;if(cr(u))a="";else if(cr(f))a="<"+(+u+1)+".0.0-0";else if(cr(c))a="<"+u+"."+(+f+1)+".0-0";else if(l)a="<="+u+"."+f+"."+c+"-"+l;else a="<="+a;return(r+" "+a).trim()}ar.prototype.test=function(e){if(!e)return false;for(var r=0;r<this.set.length;r++){if(dr(this.set[r],e))return true}return false};function dr(e,r){for(var t=0;t<e.length;t++){if(!e[t].test(r))return false}return true}e.satisfies=wr;function wr(e,r,t){try{r=new ar(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=yr;function yr(e,r,t){return e.filter(function(e){return wr(e,r,t)}).sort(function(e,r){return K(e,r,t)})[0]||null}e.validRange=$r;function $r(e,r){try{return new ar(e,r).range||"*"}catch(t){return null}}if(typeof define==="function"&&define.amd)define(e)}(typeof exports==="object"?exports:typeof define==="function"&&define.amd?{}:semver={});
\ No newline at end of file
['=1.2.3', '1.2.3-beta'],
['>1.2', '1.2.8'],
// invalid ranges never satisfied!
- ['blerg', '1.2.3']
+ ['blerg', '1.2.3'],
+ ['git+https://user:password0123@github.com/foo', '123.0.0', true]
].forEach(function(v) {
var range = v[0];
var ver = v[1];
test('\nmax satisfying', function(t) {
[[['1.2.3', '1.2.4'], '1.2', '1.2.4'],
[['1.2.4', '1.2.3'], '1.2', '1.2.4'],
- [['1.2.3','1.2.4','1.2.5','1.2.6'], '~1.2.3', '1.2.6']
+ [['1.2.3','1.2.4','1.2.5','1.2.6'], '~1.2.3', '1.2.6'],
+ [['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', '2.0.0b3', '2.0.0', '2.1.0'], '~2.0.0', '2.0.0', true]
].forEach(function(v) {
var versions = v[0];
var range = v[1];
--- /dev/null
+Copyright (c) 2013 Forbes Lindesay
+
+The BSD License
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The MIT License (MIT)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
[![Build Status](https://travis-ci.org/ForbesLindesay/sha.png?branch=master)](https://travis-ci.org/ForbesLindesay/sha)
[![Dependency Status](https://gemnasium.com/ForbesLindesay/sha.png)](https://gemnasium.com/ForbesLindesay/sha)
+[![NPM version](https://badge.fury.io/js/sha.png)](http://badge.fury.io/js/sha)
## Installation
## API
-### check(fileName, expected, [options,] cb)
+### check(fileName, expected, [options,] cb) / checkSync(filename, expected, [options])
Asynchronously check that `fileName` has a "hash" of `expected`. The callback will be called with either `null` or an error (indicating that they did not match).
- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`
-### get(fileName, [options,] cb)
+### get(fileName, [options,] cb) / getSync(filename, [options])
Asynchronously get the "hash" of `fileName`. The callback will be called with an optional `error` object and the (lower cased) hex digest of the hash.
- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`
+### stream(expected, [options])
+
+Check the hash of a stream without ever buffering it. This is a pass through stream so you can do things like:
+
+```js
+fs.createReadStream('src')
+ .pipe(sha.stream('expected'))
+ .pipe(fs.createWriteStream('dest'))
+```
+
+`dest` will be a complete copy of `src` and an error will be emitted if the hash did not match `'expected'`.
+
+Options:
+
+- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`
+
## License
-BSD
+You may use this software under the BSD or MIT. Take your pick. If you want me to release it under another license, open a pull request.
\ No newline at end of file
+'use strict'
+
+var Transform = require('stream').Transform || require('readable-stream').Transform
var crypto = require('crypto')
var fs
try {
}
exports.check = check
+exports.checkSync = checkSync
exports.get = get
+exports.getSync = getSync
+exports.stream = stream
function check(file, expected, options, cb) {
if (typeof options === 'function') {
- cb = options;
- options = undefined;
+ cb = options
+ options = undefined
}
- expected = expected.toLowerCase().trim();
+ expected = expected.toLowerCase().trim()
get(file, options, function (er, actual) {
if (er) {
- if (er.message) er.message += ' while getting shasum for ' + file;
+ if (er.message) er.message += ' while getting shasum for ' + file
return cb(er)
}
- if (actual === expected) return cb(null);
+ if (actual === expected) return cb(null)
cb(new Error(
'shasum check failed for ' + file + '\n'
+ 'Expected: ' + expected + '\n'
+ 'Actual: ' + actual))
})
}
+function checkSync(file, expected, options, cb) {
+ expected = expected.toLowerCase().trim()
+ var actual
+ try {
+ actual = getSync(file, options)
+ } catch (er) {
+ if (er.message) er.message += ' while getting shasum for ' + file
+ throw er
+ }
+ if (actual !== expected) {
+ var ex = new Error(
+ 'shasum check failed for ' + file + '\n'
+ + 'Expected: ' + expected + '\n'
+ + 'Actual: ' + actual)
+ throw ex
+ }
+}
+
function get(file, options, cb) {
if (typeof options === 'function') {
- cb = options;
- options = undefined;
+ cb = options
+ options = undefined
}
- options = options || {};
- var algorithm = options.algorithm || 'sha1';
+ options = options || {}
+ var algorithm = options.algorithm || 'sha1'
var hash = crypto.createHash(algorithm)
var source = fs.createReadStream(file)
var errState = null
cb(null, actual)
})
}
+
+function getSync(file, options) {
+ options = options || {}
+ var algorithm = options.algorithm || 'sha1'
+ var hash = crypto.createHash(algorithm)
+ var source = fs.readFileSync(file)
+ hash.update(source)
+ return hash.digest("hex").toLowerCase().trim()
+}
+
+function stream(expected, options) {
+ expected = expected.toLowerCase().trim()
+ options = options || {}
+ var algorithm = options.algorithm || 'sha1'
+ var hash = crypto.createHash(algorithm)
+
+ var stream = new Transform()
+ stream._transform = function (chunk, encoding, callback) {
+ hash.update(chunk)
+ stream.push(chunk)
+ callback()
+ }
+ stream._flush = function (cb) {
+ var actual = hash.digest("hex").toLowerCase().trim()
+ if (actual === expected) return cb(null)
+ cb(new Error(
+ 'shasum check failed for:\n'
+ + ' Expected: ' + expected + '\n'
+ + ' Actual: ' + actual))
+ this.push(null)
+ }
+ return stream
+}
\ No newline at end of file
{
"name": "sha",
- "version": "1.0.1",
+ "version": "1.2.1",
"description": "Check and get file hashes",
"scripts": {
- "test": "mocha -R list"
+ "test": "mocha -R spec"
},
"repository": {
"type": "git",
},
"license": "BSD",
"optionalDependencies": {
- "graceful-fs": "1.2"
+ "graceful-fs": "2",
+ "readable-stream": "1.0"
},
"devDependencies": {
"mocha": "~1.9.0"
},
- "readme": "# sha\r\n\r\nCheck and get file hashes (using any algorithm)\r\n\r\n[![Build Status](https://travis-ci.org/ForbesLindesay/sha.png?branch=master)](https://travis-ci.org/ForbesLindesay/sha)\r\n[![Dependency Status](https://gemnasium.com/ForbesLindesay/sha.png)](https://gemnasium.com/ForbesLindesay/sha)\r\n\r\n## Installation\r\n\r\n $ npm install sha\r\n\r\n## API\r\n\r\n### check(fileName, expected, [options,] cb)\r\n\r\nAsynchronously check that `fileName` has a \"hash\" of `expected`. The callback will be called with either `null` or an error (indicating that they did not match).\r\n\r\nOptions:\r\n\r\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\r\n\r\n### get(fileName, [options,] cb)\r\n\r\nAsynchronously get the \"hash\" of `fileName`. The callback will be called with an optional `error` object and the (lower cased) hex digest of the hash.\r\n\r\nOptions:\r\n\r\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\r\n\r\n## License\r\n\r\nBSD\r\n",
+ "readme": "# sha\n\nCheck and get file hashes (using any algorithm)\n\n[![Build Status](https://travis-ci.org/ForbesLindesay/sha.png?branch=master)](https://travis-ci.org/ForbesLindesay/sha)\n[![Dependency Status](https://gemnasium.com/ForbesLindesay/sha.png)](https://gemnasium.com/ForbesLindesay/sha)\n[![NPM version](https://badge.fury.io/js/sha.png)](http://badge.fury.io/js/sha)\n\n## Installation\n\n $ npm install sha\n\n## API\n\n### check(fileName, expected, [options,] cb) / checkSync(filename, expected, [options])\n\nAsynchronously check that `fileName` has a \"hash\" of `expected`. The callback will be called with either `null` or an error (indicating that they did not match).\n\nOptions:\n\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\n\n### get(fileName, [options,] cb) / getSync(filename, [options])\n\nAsynchronously get the \"hash\" of `fileName`. The callback will be called with an optional `error` object and the (lower cased) hex digest of the hash.\n\nOptions:\n\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\n\n### stream(expected, [options])\n\nCheck the hash of a stream without ever buffering it. This is a pass through stream so you can do things like:\n\n```js\nfs.createReadStream('src')\n .pipe(sha.stream('expected'))\n .pipe(fs.createWriteStream('dest'))\n```\n\n`dest` will be a complete copy of `src` and an error will be emitted if the hash did not match `'expected'`.\n\nOptions:\n\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\n\n## License\n\nYou may use this software under the BSD or MIT. Take your pick. If you want me to release it under another license, open a pull request.",
"readmeFilename": "README.md",
- "_id": "sha@1.0.1",
+ "bugs": {
+ "url": "https://github.com/ForbesLindesay/sha/issues"
+ },
"dependencies": {
- "graceful-fs": "1.2"
+ "graceful-fs": "2",
+ "readable-stream": "1.0"
},
- "_from": "sha@~1.0.1"
+ "_id": "sha@1.2.1",
+ "_from": "sha@latest"
}
1. Be able to parse and reasonably extract the contents of any tar file
created by any program that creates tar files, period.
- At least, this includes every version of:
+ At least, this includes every version of:
- * bsdtar
- * gnutar
- * solaris posix tar
- * Joerg Schilling's star ("Schilly tar")
+ * bsdtar
+ * gnutar
+ * solaris posix tar
+ * Joerg Schilling's star ("Schilly tar")
-2. Create tar files that can be extracted by any of the following tar
- programs:
+2. Create tar files that can be extracted by any of the following tar programs:
- * bsdtar/libarchive version 2.6.2
- * gnutar 1.15 and above
- * SunOS Posix tar
- * Joerg Schilling's star ("Schilly tar")
+ * bsdtar/libarchive version 2.6.2
+ * gnutar 1.15 and above
+ * SunOS Posix tar
+ * Joerg Schilling's star ("Schilly tar")
-3. 100% test coverage. Speed is important. Correctness is slightly
- more important.
+3. 100% test coverage. Speed is important. Correctness is slightly more important.
4. Create the kind of tar interface that Node users would want to use.
-5. Satisfy npm's needs for a portable tar implementation with a
- JavaScript interface.
+5. Satisfy npm's needs for a portable tar implementation with a JavaScript interface.
6. No excuses. No complaining. No tolerance for failure.
})
}
+inherits(BufferEntry, Entry)
+
// collect the bytes as they come in.
BufferEntry.prototype.write = function (c) {
c.copy(this._buffer, this._offset)
this._offset += c.length
Entry.prototype.write.call(this, c)
}
-
-inherits(BufferEntry, Entry)
this._setProps()
}
-inherits(Entry, Stream,
-{ write: function (c) {
- if (this._ending) this.error("write() after end()", null, true)
- if (this._remaining === 0) {
- this.error("invalid bytes past eof")
- }
+inherits(Entry, Stream)
- // often we'll get a bunch of \0 at the end of the last write,
- // since chunks will always be 512 bytes when reading a tarball.
- if (c.length > this._remaining) {
- c = c.slice(0, this._remaining)
- }
- this._remaining -= c.length
+Entry.prototype.write = function (c) {
+ if (this._ending) this.error("write() after end()", null, true)
+ if (this._remaining === 0) {
+ this.error("invalid bytes past eof")
+ }
- // put it on the stack.
- var ql = this._queueLen
- this._queue.push(c)
- this._queueLen ++
+ // often we'll get a bunch of \0 at the end of the last write,
+ // since chunks will always be 512 bytes when reading a tarball.
+ if (c.length > this._remaining) {
+ c = c.slice(0, this._remaining)
+ }
+ this._remaining -= c.length
- this._read()
+ // put it on the stack.
+ var ql = this._queueLen
+ this._queue.push(c)
+ this._queueLen ++
- // either paused, or buffered
- if (this._paused || ql > 0) {
- this._needDrain = true
- return false
- }
+ this._read()
- return true
+ // either paused, or buffered
+ if (this._paused || ql > 0) {
+ this._needDrain = true
+ return false
}
-, end: function (c) {
- if (c) this.write(c)
- this._ending = true
- this._read()
- }
+ return true
+}
-, pause: function () {
- this._paused = true
- this.emit("pause")
- }
+Entry.prototype.end = function (c) {
+ if (c) this.write(c)
+ this._ending = true
+ this._read()
+}
-, resume: function () {
- // console.error(" Tar Entry resume", this.path)
- this.emit("resume")
- this._paused = false
- this._read()
- return this._queueLen - this._index > 1
- }
+Entry.prototype.pause = function () {
+ this._paused = true
+ this.emit("pause")
+}
+
+Entry.prototype.resume = function () {
+ // console.error(" Tar Entry resume", this.path)
+ this.emit("resume")
+ this._paused = false
+ this._read()
+ return this._queueLen - this._index > 1
+}
// This is bound to the instance
-, _read: function () {
- // console.error(" Tar Entry _read", this.path)
+Entry.prototype._read = function () {
+ // console.error(" Tar Entry _read", this.path)
- if (this._paused || this._reading || this._ended) return
+ if (this._paused || this._reading || this._ended) return
- // set this flag so that event handlers don't inadvertently
- // get multiple _read() calls running.
- this._reading = true
+ // set this flag so that event handlers don't inadvertently
+ // get multiple _read() calls running.
+ this._reading = true
- // have any data to emit?
- while (this._index < this._queueLen && !this._paused) {
- var chunk = this._queue[this._index ++]
- this.emit("data", chunk)
- }
+ // have any data to emit?
+ while (this._index < this._queueLen && !this._paused) {
+ var chunk = this._queue[this._index ++]
+ this.emit("data", chunk)
+ }
- // check if we're drained
- if (this._index >= this._queueLen) {
- this._queue.length = this._queueLen = this._index = 0
- if (this._needDrain) {
- this._needDrain = false
- this.emit("drain")
- }
- if (this._ending) {
- this._ended = true
- this.emit("end")
- }
+ // check if we're drained
+ if (this._index >= this._queueLen) {
+ this._queue.length = this._queueLen = this._index = 0
+ if (this._needDrain) {
+ this._needDrain = false
+ this.emit("drain")
}
-
- // if the queue gets too big, then pluck off whatever we can.
- // this should be fairly rare.
- var mql = this._maxQueueLen
- if (this._queueLen > mql && this._index > 0) {
- mql = Math.min(this._index, mql)
- this._index -= mql
- this._queueLen -= mql
- this._queue = this._queue.slice(mql)
+ if (this._ending) {
+ this._ended = true
+ this.emit("end")
}
+ }
- this._reading = false
+ // if the queue gets too big, then pluck off whatever we can.
+ // this should be fairly rare.
+ var mql = this._maxQueueLen
+ if (this._queueLen > mql && this._index > 0) {
+ mql = Math.min(this._index, mql)
+ this._index -= mql
+ this._queueLen -= mql
+ this._queue = this._queue.slice(mql)
}
-, _setProps: function () {
- // props = extended->global->header->{}
- var header = this._header
- , extended = this._extended
- , global = this._global
- , props = this.props
-
- // first get the values from the normal header.
- var fields = tar.fields
- for (var f = 0; fields[f] !== null; f ++) {
- var field = fields[f]
- , val = header[field]
- if (typeof val !== "undefined") props[field] = val
- }
+ this._reading = false
+}
- // next, the global header for this file.
- // numeric values, etc, will have already been parsed.
- ;[global, extended].forEach(function (p) {
- Object.keys(p).forEach(function (f) {
- if (typeof p[f] !== "undefined") props[f] = p[f]
- })
- })
+Entry.prototype._setProps = function () {
+ // props = extended->global->header->{}
+ var header = this._header
+ , extended = this._extended
+ , global = this._global
+ , props = this.props
+
+ // first get the values from the normal header.
+ var fields = tar.fields
+ for (var f = 0; fields[f] !== null; f ++) {
+ var field = fields[f]
+ , val = header[field]
+ if (typeof val !== "undefined") props[field] = val
+ }
- // no nulls allowed in path or linkpath
- ;["path", "linkpath"].forEach(function (p) {
- if (props.hasOwnProperty(p)) {
- props[p] = props[p].split("\0")[0]
- }
+ // next, the global header for this file.
+ // numeric values, etc, will have already been parsed.
+ ;[global, extended].forEach(function (p) {
+ Object.keys(p).forEach(function (f) {
+ if (typeof p[f] !== "undefined") props[f] = p[f]
})
+ })
+ // no nulls allowed in path or linkpath
+ ;["path", "linkpath"].forEach(function (p) {
+ if (props.hasOwnProperty(p)) {
+ props[p] = props[p].split("\0")[0]
+ }
+ })
- // set date fields to be a proper date
- ;["mtime", "ctime", "atime"].forEach(function (p) {
- if (props.hasOwnProperty(p)) {
- props[p] = new Date(props[p] * 1000)
- }
- })
- // set the type so that we know what kind of file to create
- var type
- switch (tar.types[props.type]) {
- case "OldFile":
- case "ContiguousFile":
- type = "File"
- break
-
- case "GNUDumpDir":
- type = "Directory"
- break
-
- case undefined:
- type = "Unknown"
- break
-
- case "Link":
- case "SymbolicLink":
- case "CharacterDevice":
- case "BlockDevice":
- case "Directory":
- case "FIFO":
- default:
- type = tar.types[props.type]
+ // set date fields to be a proper date
+ ;["mtime", "ctime", "atime"].forEach(function (p) {
+ if (props.hasOwnProperty(p)) {
+ props[p] = new Date(props[p] * 1000)
}
+ })
- this.type = type
- this.path = props.path
- this.size = props.size
-
- // size is special, since it signals when the file needs to end.
- this._remaining = props.size
+ // set the type so that we know what kind of file to create
+ var type
+ switch (tar.types[props.type]) {
+ case "OldFile":
+ case "ContiguousFile":
+ type = "File"
+ break
+
+ case "GNUDumpDir":
+ type = "Directory"
+ break
+
+ case undefined:
+ type = "Unknown"
+ break
+
+ case "Link":
+ case "SymbolicLink":
+ case "CharacterDevice":
+ case "BlockDevice":
+ case "Directory":
+ case "FIFO":
+ default:
+ type = tar.types[props.type]
}
-, warn: fstream.warn
-, error: fstream.error
-})
+
+ this.type = type
+ this.path = props.path
+ this.size = props.size
+
+ // size is special, since it signals when the file needs to end.
+ this._remaining = props.size
+}
+
+Entry.prototype.warn = fstream.warn
+Entry.prototype.error = fstream.error
var tar = require("../tar.js")
, path = require("path")
- , inherits = require("inherits")
, TarHeader = require("./header.js")
// props is the props of the thing we need to write an
this._key = ""
}
-inherits(ExtendedHeader, Entry, { _parse: parse })
+inherits(ExtendedHeader, Entry)
+ExtendedHeader.prototype._parse = parse
var s = 0
, states = ExtendedHeader.states = {}
},
"name": "tar",
"description": "tar for node",
- "version": "0.1.17",
+ "version": "0.1.18",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-tar.git"
"test": "tap test/*.js"
},
"dependencies": {
- "inherits": "1.x",
+ "inherits": "2",
"block-stream": "*",
"fstream": "~0.1.8"
},
"rimraf": "1.x"
},
"license": "BSD",
- "readme": "# node-tar\n\nTar for Node.js.\n\n## Goals of this project\n\n1. Be able to parse and reasonably extract the contents of any tar file\n created by any program that creates tar files, period.\n\n At least, this includes every version of:\n\n * bsdtar\n * gnutar\n * solaris posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n2. Create tar files that can be extracted by any of the following tar\n programs:\n\n * bsdtar/libarchive version 2.6.2\n * gnutar 1.15 and above\n * SunOS Posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n3. 100% test coverage. Speed is important. Correctness is slightly\n more important.\n\n4. Create the kind of tar interface that Node users would want to use.\n\n5. Satisfy npm's needs for a portable tar implementation with a\n JavaScript interface.\n\n6. No excuses. No complaining. No tolerance for failure.\n\n## But isn't there already a tar.js?\n\nYes, there are a few. This one is going to be better, and it will be\nfanatically maintained, because npm will depend on it.\n\nThat's why I need to write it from scratch. Creating and extracting\ntarballs is such a large part of what npm does, I simply can't have it\nbe a black box any longer.\n\n## Didn't you have something already? Where'd it go?\n\nIt's in the \"old\" folder. It's not functional. Don't use it.\n\nIt was a useful exploration to learn the issues involved, but like most\nsoftware of any reasonable complexity, node-tar won't be useful until\nit's been written at least 3 times.\n",
+ "readme": "# node-tar\n\nTar for Node.js.\n\n## Goals of this project\n\n1. Be able to parse and reasonably extract the contents of any tar file\n created by any program that creates tar files, period.\n\n At least, this includes every version of:\n\n * bsdtar\n * gnutar\n * solaris posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n2. Create tar files that can be extracted by any of the following tar programs:\n\n * bsdtar/libarchive version 2.6.2\n * gnutar 1.15 and above\n * SunOS Posix tar\n * Joerg Schilling's star (\"Schilly tar\")\n\n3. 100% test coverage. Speed is important. Correctness is slightly more important.\n\n4. Create the kind of tar interface that Node users would want to use.\n\n5. Satisfy npm's needs for a portable tar implementation with a JavaScript interface.\n\n6. No excuses. No complaining. No tolerance for failure.\n\n## But isn't there already a tar.js?\n\nYes, there are a few. This one is going to be better, and it will be\nfanatically maintained, because npm will depend on it.\n\nThat's why I need to write it from scratch. Creating and extracting\ntarballs is such a large part of what npm does, I simply can't have it\nbe a black box any longer.\n\n## Didn't you have something already? Where'd it go?\n\nIt's in the \"old\" folder. It's not functional. Don't use it.\n\nIt was a useful exploration to learn the issues involved, but like most\nsoftware of any reasonable complexity, node-tar won't be useful until\nit's been written at least 3 times.\n",
"readmeFilename": "README.md",
- "_id": "tar@0.1.17",
- "dist": {
- "shasum": "408c8a95deb8e78a65b59b1a51a333183a32badc"
+ "bugs": {
+ "url": "https://github.com/isaacs/node-tar/issues"
},
- "_from": "tar@0.1.17",
- "_resolved": "https://registry.npmjs.org/tar/-/tar-0.1.17.tgz"
+ "_id": "tar@0.1.18",
+ "_from": "tar@latest"
}
{
- "version": "1.3.4",
+ "version": "1.3.5",
"name": "npm",
"publishConfig": {
"proprietary-attribs": false
"abbrev": "~1.0.4",
"graceful-fs": "~2.0.0",
"minimatch": "~0.2.12",
- "nopt": "~2.1.1",
+ "nopt": "~2.1.2",
"rimraf": "~2.2.0",
"request": "~2.21.0",
"which": "1",
- "tar": "~0.1.17",
+ "tar": "~0.1.18",
"fstream": "~0.1.23",
- "block-stream": "*",
- "inherits": "1",
+ "block-stream": "0.0.7",
"mkdirp": "~0.3.3",
"read": "~1.0.4",
"lru-cache": "~2.3.0",
"lockfile": "~0.4.0",
"retry": "~0.6.0",
"once": "~1.1.1",
- "npmconf": "~0.1.1",
+ "npmconf": "~0.1.2",
"opener": "~1.3.0",
"chmodr": "~0.1.0",
- "cmd-shim": "~1.1.0",
- "sha": "~1.0.1",
+ "cmd-shim": "~1.0.1",
+ "sha": "~1.2.1",
"editor": "0.0.4",
"child-process-close": "~0.1.1",
"npm-user-validate": "0.0.3"