summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-08-02 14:55:01 -0700
committerisaacs <i@izs.me>2013-08-02 14:55:22 -0700
commitbea9dfa14c5f0e248202cbc97d8f4ce20992f556 (patch)
tree94ce79da988ee63a8e92940a3caf4f54cd37e03c
parent9e1eb361e8deb3f296a3c9d01de8fcc10361443f (diff)
downloadnode-bea9dfa14c5f0e248202cbc97d8f4ce20992f556.tar.gz
npm: Upgrade to 1.3.7
-rw-r--r--deps/npm/AUTHORS91
-rw-r--r--deps/npm/LICENSE260
-rw-r--r--deps/npm/html/doc/README.html2
-rw-r--r--deps/npm/html/doc/api/npm-bin.html2
-rw-r--r--deps/npm/html/doc/api/npm-bugs.html2
-rw-r--r--deps/npm/html/doc/api/npm-commands.html2
-rw-r--r--deps/npm/html/doc/api/npm-config.html2
-rw-r--r--deps/npm/html/doc/api/npm-deprecate.html2
-rw-r--r--deps/npm/html/doc/api/npm-docs.html2
-rw-r--r--deps/npm/html/doc/api/npm-edit.html2
-rw-r--r--deps/npm/html/doc/api/npm-explore.html2
-rw-r--r--deps/npm/html/doc/api/npm-help-search.html2
-rw-r--r--deps/npm/html/doc/api/npm-init.html2
-rw-r--r--deps/npm/html/doc/api/npm-install.html2
-rw-r--r--deps/npm/html/doc/api/npm-link.html2
-rw-r--r--deps/npm/html/doc/api/npm-load.html2
-rw-r--r--deps/npm/html/doc/api/npm-ls.html2
-rw-r--r--deps/npm/html/doc/api/npm-outdated.html2
-rw-r--r--deps/npm/html/doc/api/npm-owner.html2
-rw-r--r--deps/npm/html/doc/api/npm-pack.html2
-rw-r--r--deps/npm/html/doc/api/npm-prefix.html2
-rw-r--r--deps/npm/html/doc/api/npm-prune.html2
-rw-r--r--deps/npm/html/doc/api/npm-publish.html2
-rw-r--r--deps/npm/html/doc/api/npm-rebuild.html2
-rw-r--r--deps/npm/html/doc/api/npm-restart.html2
-rw-r--r--deps/npm/html/doc/api/npm-root.html2
-rw-r--r--deps/npm/html/doc/api/npm-run-script.html2
-rw-r--r--deps/npm/html/doc/api/npm-search.html2
-rw-r--r--deps/npm/html/doc/api/npm-shrinkwrap.html2
-rw-r--r--deps/npm/html/doc/api/npm-start.html2
-rw-r--r--deps/npm/html/doc/api/npm-stop.html2
-rw-r--r--deps/npm/html/doc/api/npm-submodule.html2
-rw-r--r--deps/npm/html/doc/api/npm-tag.html2
-rw-r--r--deps/npm/html/doc/api/npm-test.html2
-rw-r--r--deps/npm/html/doc/api/npm-uninstall.html2
-rw-r--r--deps/npm/html/doc/api/npm-unpublish.html2
-rw-r--r--deps/npm/html/doc/api/npm-update.html2
-rw-r--r--deps/npm/html/doc/api/npm-version.html2
-rw-r--r--deps/npm/html/doc/api/npm-view.html2
-rw-r--r--deps/npm/html/doc/api/npm-whoami.html2
-rw-r--r--deps/npm/html/doc/api/npm.html4
-rw-r--r--deps/npm/html/doc/cli/npm-adduser.html2
-rw-r--r--deps/npm/html/doc/cli/npm-bin.html2
-rw-r--r--deps/npm/html/doc/cli/npm-bugs.html2
-rw-r--r--deps/npm/html/doc/cli/npm-build.html2
-rw-r--r--deps/npm/html/doc/cli/npm-bundle.html2
-rw-r--r--deps/npm/html/doc/cli/npm-cache.html2
-rw-r--r--deps/npm/html/doc/cli/npm-completion.html2
-rw-r--r--deps/npm/html/doc/cli/npm-config.html2
-rw-r--r--deps/npm/html/doc/cli/npm-dedupe.html2
-rw-r--r--deps/npm/html/doc/cli/npm-deprecate.html2
-rw-r--r--deps/npm/html/doc/cli/npm-docs.html2
-rw-r--r--deps/npm/html/doc/cli/npm-edit.html2
-rw-r--r--deps/npm/html/doc/cli/npm-explore.html2
-rw-r--r--deps/npm/html/doc/cli/npm-help-search.html2
-rw-r--r--deps/npm/html/doc/cli/npm-help.html2
-rw-r--r--deps/npm/html/doc/cli/npm-init.html2
-rw-r--r--deps/npm/html/doc/cli/npm-install.html2
-rw-r--r--deps/npm/html/doc/cli/npm-link.html2
-rw-r--r--deps/npm/html/doc/cli/npm-ls.html4
-rw-r--r--deps/npm/html/doc/cli/npm-outdated.html2
-rw-r--r--deps/npm/html/doc/cli/npm-owner.html2
-rw-r--r--deps/npm/html/doc/cli/npm-pack.html2
-rw-r--r--deps/npm/html/doc/cli/npm-prefix.html2
-rw-r--r--deps/npm/html/doc/cli/npm-prune.html2
-rw-r--r--deps/npm/html/doc/cli/npm-publish.html2
-rw-r--r--deps/npm/html/doc/cli/npm-rebuild.html2
-rw-r--r--deps/npm/html/doc/cli/npm-restart.html2
-rw-r--r--deps/npm/html/doc/cli/npm-rm.html2
-rw-r--r--deps/npm/html/doc/cli/npm-root.html2
-rw-r--r--deps/npm/html/doc/cli/npm-run-script.html2
-rw-r--r--deps/npm/html/doc/cli/npm-search.html2
-rw-r--r--deps/npm/html/doc/cli/npm-shrinkwrap.html2
-rw-r--r--deps/npm/html/doc/cli/npm-star.html2
-rw-r--r--deps/npm/html/doc/cli/npm-stars.html2
-rw-r--r--deps/npm/html/doc/cli/npm-start.html2
-rw-r--r--deps/npm/html/doc/cli/npm-stop.html2
-rw-r--r--deps/npm/html/doc/cli/npm-submodule.html2
-rw-r--r--deps/npm/html/doc/cli/npm-tag.html2
-rw-r--r--deps/npm/html/doc/cli/npm-test.html2
-rw-r--r--deps/npm/html/doc/cli/npm-uninstall.html2
-rw-r--r--deps/npm/html/doc/cli/npm-unpublish.html2
-rw-r--r--deps/npm/html/doc/cli/npm-update.html2
-rw-r--r--deps/npm/html/doc/cli/npm-version.html2
-rw-r--r--deps/npm/html/doc/cli/npm-view.html2
-rw-r--r--deps/npm/html/doc/cli/npm-whoami.html2
-rw-r--r--deps/npm/html/doc/cli/npm.html4
-rw-r--r--deps/npm/html/doc/files/npm-folders.html2
-rw-r--r--deps/npm/html/doc/files/npm-global.html2
-rw-r--r--deps/npm/html/doc/files/npm-json.html2
-rw-r--r--deps/npm/html/doc/files/npmrc.html2
-rw-r--r--deps/npm/html/doc/files/package.json.html2
-rw-r--r--deps/npm/html/doc/index.html2
-rw-r--r--deps/npm/html/doc/misc/npm-coding-style.html2
-rw-r--r--deps/npm/html/doc/misc/npm-config.html2
-rw-r--r--deps/npm/html/doc/misc/npm-developers.html2
-rw-r--r--deps/npm/html/doc/misc/npm-disputes.html2
-rw-r--r--deps/npm/html/doc/misc/npm-faq.html2
-rw-r--r--deps/npm/html/doc/misc/npm-index.html2
-rw-r--r--deps/npm/html/doc/misc/npm-registry.html2
-rw-r--r--deps/npm/html/doc/misc/npm-scripts.html2
-rw-r--r--deps/npm/html/doc/misc/removing-npm.html2
-rw-r--r--deps/npm/html/doc/misc/semver.html2
-rw-r--r--deps/npm/lib/cache.js6
-rw-r--r--deps/npm/lib/utils/error-handler.js2
-rw-r--r--deps/npm/man/man1/npm-ls.12
-rw-r--r--deps/npm/man/man1/npm.12
-rw-r--r--deps/npm/man/man3/npm.32
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/LICENSE27
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/README.md768
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/duplex.js1
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS32
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/examples/typer-fsr.js15
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/examples/typer.js17
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/fs.js1705
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js69
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js41
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js876
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js206
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js347
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/package.json35
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/passthrough.js1
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/readable.js6
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/common.js191
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/fixtures/x1024.txt1
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-basic.js475
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-compatibility.js50
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-finish-pipe.js41
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-large-read-stall.js82
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-objects.js348
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-pipe-error-handling.js105
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-push.js138
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-read-sync-stack.js54
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-empty-buffer-no-eof.js119
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-from-list.js120
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-legacy-drain.js75
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-non-empty-end.js78
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-set-encoding.js312
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-transform.js435
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-unpipe-drain.js76
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-unpipe-leak.js74
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-writable.js328
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/transform.js1
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/writable.js1
-rw-r--r--deps/npm/node_modules/sha/node_modules/readable-stream/zlib.js452
-rw-r--r--deps/npm/node_modules/sha/package.json2
-rw-r--r--deps/npm/package.json9
147 files changed, 8088 insertions, 198 deletions
diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS
index 4d964f4bd..f159ffae2 100644
--- a/deps/npm/AUTHORS
+++ b/deps/npm/AUTHORS
@@ -1,48 +1,48 @@
# Authors sorted by whether or not they're me
-Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)
-Steve Steiner <ssteinerX@gmail.com> (http://websaucesoftware.com/blog/)
-Mikeal Rogers <mikeal.rogers@gmail.com> (http://www.mikealrogers.com/)
-Aaron Blohowiak <aaron.blohowiak@gmail.com> (http://aaronblohowiak.com/)
-Martyn Smith <martyn@dollyfish.net.nz> (http://dollyfish.net.nz/)
-Mathias Pettersson <mape@mape.me> (http://mape.me/)
-Brian Hammond <brian@fictorial.com> (http://fictorial.com/)
-Charlie Robbins <charlie.robbins@gmail.com> (http://www.charlierobbins.com/)
-Francisco Treacy <francisco.treacy@gmail.com> (http://franciscotreacy.com/)
-Cliffano Subagio <cliffano@gmail.com> (http://blog.cliffano.com/)
-Christian Eager <christian.eager@nokia.com> (http://perpenduum.com)
-Dav Glass <davglass@gmail.com> (http://blog.davglass.com)
+Isaac Z. Schlueter <i@izs.me>
+Steve Steiner <ssteinerX@gmail.com>
+Mikeal Rogers <mikeal.rogers@gmail.com>
+Aaron Blohowiak <aaron.blohowiak@gmail.com>
+Martyn Smith <martyn@dollyfish.net.nz>
+Mathias Pettersson <mape@mape.me>
+Brian Hammond <brian@fictorial.com>
+Charlie Robbins <charlie.robbins@gmail.com>
+Francisco Treacy <francisco.treacy@gmail.com>
+Cliffano Subagio <cliffano@gmail.com>
+Christian Eager <christian.eager@nokia.com>
+Dav Glass <davglass@gmail.com>
Alex K. Wolfe <alexkwolfe@gmail.com>
-James Sanders <jimmyjazz14@gmail.com> (http://james-sanders.com/)
-Reid Burke <me@reidburke.com> (http://reidburke.com/)
-Arlo Breault <arlolra@gmail.com> (http://thoughtherder.com/)
-Timo Derstappen <teemow@gmail.com> (http://teemow.com)
+James Sanders <jimmyjazz14@gmail.com>
+Reid Burke <me@reidburke.com>
+Arlo Breault <arlolra@gmail.com>
+Timo Derstappen <teemow@gmail.com>
Bradley Meck <bradley.meck@gmail.com>
-Bart Teeuwisse <bart.teeuwisse@thecodemill.biz> (http://thecodemill.biz/)
-Ben Noordhuis <info@bnoordhuis.nl> (http://bnoordhuis.nl/)
-Tor Valamo <tor.valamo@gmail.com> (http://www.magnimedia.no/)
-Whyme.Lyu <5longluna@gmail.com> (http://whyme.kuantu.com/)
+Bart Teeuwisse <bart.teeuwisse@thecodemill.biz>
+Ben Noordhuis <info@bnoordhuis.nl>
+Tor Valamo <tor.valamo@gmail.com>
+Whyme.Lyu <5longluna@gmail.com>
Olivier Melcher <olivier.melcher@gmail.com>
-Tomaž Muraus <kami@k5-storitve.net> (http://www.tomaz-muraus.info)
-Evan Meagher <evan.meagher@gmail.com> (http://evanmeagher.net/)
-Orlando Vazquez <ovazquez@gmail.com> (http://2wycked.net/)
+Tomaž Muraus <kami@k5-storitve.net>
+Evan Meagher <evan.meagher@gmail.com>
+Orlando Vazquez <ovazquez@gmail.com>
George Miroshnykov <gmiroshnykov@lohika.com>
-Geoff Flarity (http://ca.linkedin.com/pub/geoff-flarity/a/536/43a)
+Geoff Flarity <geoff.flarity@gmail.com>
Pete Kruckenberg <pete@kruckenberg.com>
-Laurie Harper <laurie@holoweb.net> (http://laurie.holoweb.net/)
+Laurie Harper <laurie@holoweb.net>
Chris Wong <chris@chriswongstudio.com>
-Max Goodman <c@chromacode.com> (http://chromacode.com/)
+Max Goodman <c@chromacode.com>
Scott Bronson <brons_github@rinspin.com>
Federico Romero <federomero@gmail.com>
-Visnu Pitiyanuvath <visnupx@gmail.com> (http://visnup.com)
-Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com/)
-Mark Cahill <mark@tiemonster.info> (http://www.tiemonster.info/)
+Visnu Pitiyanuvath <visnupx@gmail.com>
+Irakli Gozalishvili <rfobic@gmail.com>
+Mark Cahill <mark@tiemonster.info>
Zearin <zearin@gonk.net>
Iain Sproat <iainsproat@gmail.com>
-Trent Mick <trentm@gmail.com> (http://trentm.com/)
-Felix Geisendörfer <felix@debuggable.com> (http://www.debuggable.com/)
-Conny Brunnkvist <cbrunnkvist@gmail.com> (http://twitter.com/connyb)
-Will Elwood <w.elwood08@gmail.com> (https://github.com/welwood08)
-Oleg Efimov <efimovov@gmail.com> (http://sannis.ru)
+Trent Mick <trentm@gmail.com>
+Felix Geisendörfer <felix@debuggable.com>
+Conny Brunnkvist <cbrunnkvist@gmail.com>
+Will Elwood <w.elwood08@gmail.com>
+Oleg Efimov <efimovov@gmail.com>
Martin Cooper <mfncooper@gmail.com>
Jameson Little <t.jameson.little@gmail.com>
cspotcode <cspotcode@gmail.com>
@@ -90,3 +90,26 @@ Paul Miller <paul@paulmillr.com>
seebees <seebees@gmail.com>
Carl Lange <carl@flax.ie>
Jan Lehnardt <jan@apache.org>
+Alexey Kreschuk <akrsch@gmail.com>
+Di Wu <dwu@palantir.com>
+Florian Margaine <florian@margaine.com>
+Forbes Lindesay <forbes@lindesay.co.uk>
+Ian Babrou <ibobrik@gmail.com>
+Jaakko Manninen <jaakko@rocketpack.fi>
+Johan Nordberg <its@johan-nordberg.com>
+Johan Sköld <johan@skold.cc>
+Larz Conwell <larz@larz-laptop.(none)>
+Luke Arduini <luke.arduini@gmail.com>
+Marcel Klehr <mklehr@gmx.net>
+Mathias Bynens <mathias@qiwi.be>
+Matt Lunn <matt@mattlunn.me.uk>
+Matt McClure <matt.mcclure@mapmyfitness.com>
+Nirk Niggler <nirk.niggler@gmail.com>
+Paolo Fragomeni <paolo@async.ly>
+Jake Verbaten (Raynos) <raynos2@gmail.com>
+Robert Kowalski <rok@kowalski.gd>
+Schabse Laks <Dev@SLaks.net>
+Stuart Knightley <stuart@stuartk.com>
+Stuart P. Bentley <stuart@testtrack4.com>
+Vaz Allen <vaz@tryptid.com>
+elisee <elisee@sparklin.org>
diff --git a/deps/npm/LICENSE b/deps/npm/LICENSE
index c0f51a741..bdca79502 100644
--- a/deps/npm/LICENSE
+++ b/deps/npm/LICENSE
@@ -1,42 +1,218 @@
-Copyright (c) Isaac Z. Schlueter (the "Original Author")
+Copyright (c) Isaac Z. Schlueter
All rights reserved.
-MIT +no-false-attribs License
-
-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.
-
-Distributions of all or part of the Software intended to be used
-by the recipients as they would use the unmodified Software,
-containing modifications that substantially alter, remove, or
-disable functionality of the Software, outside of the documented
-configuration mechanisms provided by the Software, shall be
-modified such that the Original Author's bug reporting email
-addresses and urls are either replaced with the contact information
-of the parties responsible for the changes, or removed entirely.
-
-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.
-
-
-Except where noted, this license applies to any and all software
-programs and associated documentation files created by the
-Original Author, when distributed with the Software.
+npm is released under the Artistic 2.0 License.
+The text of the License follows:
+
+
+--------
+
+
+The Artistic License 2.0
+
+Copyright (c) 2000-2006, The Perl Foundation.
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+Preamble
+
+This license establishes the terms under which a given free software
+Package may be copied, modified, distributed, and/or redistributed.
+The intent is that the Copyright Holder maintains some artistic
+control over the development of that Package while still keeping the
+Package available as open source and free software.
+
+You are always permitted to make arrangements wholly outside of this
+license directly with the Copyright Holder of a given Package. If the
+terms of this license do not permit the full use that you propose to
+make of the Package, you should contact the Copyright Holder and seek
+a different licensing arrangement.
+
+Definitions
+
+ "Copyright Holder" means the individual(s) or organization(s)
+ named in the copyright notice for the entire Package.
+
+ "Contributor" means any party that has contributed code or other
+ material to the Package, in accordance with the Copyright Holder's
+ procedures.
+
+ "You" and "your" means any person who would like to copy,
+ distribute, or modify the Package.
+
+ "Package" means the collection of files distributed by the
+ Copyright Holder, and derivatives of that collection and/or of
+ those files. A given Package may consist of either the Standard
+ Version, or a Modified Version.
+
+ "Distribute" means providing a copy of the Package or making it
+ accessible to anyone else, or in the case of a company or
+ organization, to others outside of your company or organization.
+
+ "Distributor Fee" means any fee that you charge for Distributing
+ this Package or providing support for this Package to another
+ party. It does not mean licensing fees.
+
+ "Standard Version" refers to the Package if it has not been
+ modified, or has been modified only in ways explicitly requested
+ by the Copyright Holder.
+
+ "Modified Version" means the Package, if it has been changed, and
+ such changes were not explicitly requested by the Copyright
+ Holder.
+
+ "Original License" means this Artistic License as Distributed with
+ the Standard Version of the Package, in its current version or as
+ it may be modified by The Perl Foundation in the future.
+
+ "Source" form means the source code, documentation source, and
+ configuration files for the Package.
+
+ "Compiled" form means the compiled bytecode, object code, binary,
+ or any other form resulting from mechanical transformation or
+ translation of the Source form.
+
+
+Permission for Use and Modification Without Distribution
+
+(1) You are permitted to use the Standard Version and create and use
+Modified Versions for any purpose without restriction, provided that
+you do not Distribute the Modified Version.
+
+
+Permissions for Redistribution of the Standard Version
+
+(2) You may Distribute verbatim copies of the Source form of the
+Standard Version of this Package in any medium without restriction,
+either gratis or for a Distributor Fee, provided that you duplicate
+all of the original copyright notices and associated disclaimers. At
+your discretion, such verbatim copies may or may not include a
+Compiled form of the Package.
+
+(3) You may apply any bug fixes, portability changes, and other
+modifications made available from the Copyright Holder. The resulting
+Package will still be considered the Standard Version, and as such
+will be subject to the Original License.
+
+
+Distribution of Modified Versions of the Package as Source
+
+(4) You may Distribute your Modified Version as Source (either gratis
+or for a Distributor Fee, and with or without a Compiled form of the
+Modified Version) provided that you clearly document how it differs
+from the Standard Version, including, but not limited to, documenting
+any non-standard features, executables, or modules, and provided that
+you do at least ONE of the following:
+
+ (a) make the Modified Version available to the Copyright Holder
+ of the Standard Version, under the Original License, so that the
+ Copyright Holder may include your modifications in the Standard
+ Version.
+
+ (b) ensure that installation of your Modified Version does not
+ prevent the user installing or running the Standard Version. In
+ addition, the Modified Version must bear a name that is different
+ from the name of the Standard Version.
+
+ (c) allow anyone who receives a copy of the Modified Version to
+ make the Source form of the Modified Version available to others
+ under
+
+ (i) the Original License or
+
+ (ii) a license that permits the licensee to freely copy,
+ modify and redistribute the Modified Version using the same
+ licensing terms that apply to the copy that the licensee
+ received, and requires that the Source form of the Modified
+ Version, and of any works derived from it, be made freely
+ available in that license fees are prohibited but Distributor
+ Fees are allowed.
+
+
+Distribution of Compiled Forms of the Standard Version
+or Modified Versions without the Source
+
+(5) You may Distribute Compiled forms of the Standard Version without
+the Source, provided that you include complete instructions on how to
+get the Source of the Standard Version. Such instructions must be
+valid at the time of your distribution. If these instructions, at any
+time while you are carrying out such distribution, become invalid, you
+must provide new instructions on demand or cease further distribution.
+If you provide valid instructions or cease distribution within thirty
+days after you become aware that the instructions are invalid, then
+you do not forfeit any of your rights under this license.
+
+(6) You may Distribute a Modified Version in Compiled form without
+the Source, provided that you comply with Section 4 with respect to
+the Source of the Modified Version.
+
+
+Aggregating or Linking the Package
+
+(7) You may aggregate the Package (either the Standard Version or
+Modified Version) with other packages and Distribute the resulting
+aggregation provided that you do not charge a licensing fee for the
+Package. Distributor Fees are permitted, and licensing fees for other
+components in the aggregation are permitted. The terms of this license
+apply to the use and Distribution of the Standard or Modified Versions
+as included in the aggregation.
+
+(8) You are permitted to link Modified and Standard Versions with
+other works, to embed the Package in a larger work of your own, or to
+build stand-alone binary or bytecode versions of applications that
+include the Package, and Distribute the result without restriction,
+provided the result does not expose a direct interface to the Package.
+
+
+Items That are Not Considered Part of a Modified Version
+
+(9) Works (including, but not limited to, modules and scripts) that
+merely extend or make use of the Package, do not, by themselves, cause
+the Package to be a Modified Version. In addition, such works are not
+considered parts of the Package itself, and are not subject to the
+terms of this license.
+
+
+General Provisions
+
+(10) Any use, modification, and distribution of the Standard or
+Modified Versions is governed by this Artistic License. By using,
+modifying or distributing the Package, you accept this license. Do not
+use, modify, or distribute the Package, if you do not accept this
+license.
+
+(11) If your Modified Version has been derived from a Modified
+Version made by someone other than you, you are nevertheless required
+to ensure that your Modified Version complies with the requirements of
+this license.
+
+(12) This license does not grant you the right to use any trademark,
+service mark, tradename, or logo of the Copyright Holder.
+
+(13) This license includes the non-exclusive, worldwide,
+free-of-charge patent license to make, have made, use, offer to sell,
+sell, import and otherwise transfer the Package with respect to any
+patent claims licensable by the Copyright Holder that are necessarily
+infringed by the Package. If you institute patent litigation
+(including a cross-claim or counterclaim) against any party alleging
+that the Package constitutes direct or contributory patent
+infringement, then this Artistic License to you shall terminate on the
+date that such litigation is filed.
+
+(14) Disclaimer of Warranty:
+THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
+IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL
+LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+--------
+
"Node.js" and "node" trademark Joyent, Inc. npm is not officially
part of the Node.js project, and is neither owned by nor
@@ -55,11 +231,5 @@ Copyright (c) by Tjarda Koster, http://jelloween.deviantart.com
included for use in the npm website and documentation,
used with permission.
-This program uses "request", Copyright (c) Mikeal Rogers,
-according to the terms of the Apache license.
-
-This program uses "mkdirp", Copyright (c) James Halliday,
-according to the terms of the MIT/X11 license.
-
-This program uses "opener", Copyright (c) Domenic Denicola,
-according to the terms of the DWTFPL2 license.
+This program uses several Node modules contained in the node_modules/
+subdirectory, according to the terms of their respective licenses.
diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html
index d9c309b10..2cd2cb537 100644
--- a/deps/npm/html/doc/README.html
+++ b/deps/npm/html/doc/README.html
@@ -240,7 +240,7 @@ will no doubt tell you to put the output in a gist or email.</p>
<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> &mdash; npm@1.3.5</p>
+<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-bin.html b/deps/npm/html/doc/api/npm-bin.html
index e939f73bd..0ea3cfb7d 100644
--- a/deps/npm/html/doc/api/npm-bin.html
+++ b/deps/npm/html/doc/api/npm-bin.html
@@ -19,7 +19,7 @@
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-bin &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-bugs.html b/deps/npm/html/doc/api/npm-bugs.html
index beb19c688..44a6ff2a5 100644
--- a/deps/npm/html/doc/api/npm-bugs.html
+++ b/deps/npm/html/doc/api/npm-bugs.html
@@ -25,7 +25,7 @@ optional version number.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-bugs &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-commands.html b/deps/npm/html/doc/api/npm-commands.html
index d7a0d7a64..6f6287566 100644
--- a/deps/npm/html/doc/api/npm-commands.html
+++ b/deps/npm/html/doc/api/npm-commands.html
@@ -28,7 +28,7 @@ usage, or <code>man 3 npm-&lt;command&gt;</code> for programmatic usage.</p>
<ul><li><a href="../misc/npm-index.html">npm-index(7)</a></li></ul>
</div>
-<p id="footer">npm-commands &mdash; npm@1.3.5</p>
+<p id="footer">npm-commands &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-config.html b/deps/npm/html/doc/api/npm-config.html
index c7c9b7e2c..205d44db5 100644
--- a/deps/npm/html/doc/api/npm-config.html
+++ b/deps/npm/html/doc/api/npm-config.html
@@ -33,7 +33,7 @@ functions instead.</p>
<ul><li><a href="../api/npm.html">npm(3)</a></li></ul>
</div>
-<p id="footer">npm-config &mdash; npm@1.3.5</p>
+<p id="footer">npm-config &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-deprecate.html b/deps/npm/html/doc/api/npm-deprecate.html
index 3336d055e..480b28d53 100644
--- a/deps/npm/html/doc/api/npm-deprecate.html
+++ b/deps/npm/html/doc/api/npm-deprecate.html
@@ -32,7 +32,7 @@ install the package.</p></li></ul>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-deprecate &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-docs.html b/deps/npm/html/doc/api/npm-docs.html
index d6bc0b821..7f3ba6364 100644
--- a/deps/npm/html/doc/api/npm-docs.html
+++ b/deps/npm/html/doc/api/npm-docs.html
@@ -25,7 +25,7 @@ optional version number.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-docs &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-edit.html b/deps/npm/html/doc/api/npm-edit.html
index 66a942e27..f7aa95de9 100644
--- a/deps/npm/html/doc/api/npm-edit.html
+++ b/deps/npm/html/doc/api/npm-edit.html
@@ -30,7 +30,7 @@ to open. The package can optionally have a version number attached.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-edit &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-explore.html b/deps/npm/html/doc/api/npm-explore.html
index b970b95d8..81fe236d1 100644
--- a/deps/npm/html/doc/api/npm-explore.html
+++ b/deps/npm/html/doc/api/npm-explore.html
@@ -24,7 +24,7 @@ sure to use <code>npm rebuild &lt;pkg&gt;</code> if you make any changes.</p>
<p>The first element in the &#39;args&#39; 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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-explore &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-help-search.html b/deps/npm/html/doc/api/npm-help-search.html
index b4b6517ea..7980b46bb 100644
--- a/deps/npm/html/doc/api/npm-help-search.html
+++ b/deps/npm/html/doc/api/npm-help-search.html
@@ -32,7 +32,7 @@ Name of the file that matched</li></ul>
<p>The silent parameter is not neccessary not used, but it may in the future.</p>
</div>
-<p id="footer">npm-help-search &mdash; npm@1.3.5</p>
+<p id="footer">npm-help-search &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-init.html b/deps/npm/html/doc/api/npm-init.html
index 3d7a563f7..24f7f558d 100644
--- a/deps/npm/html/doc/api/npm-init.html
+++ b/deps/npm/html/doc/api/npm-init.html
@@ -35,7 +35,7 @@ then go ahead and use this programmatically.</p>
<p><a href="../files/package.json.html">package.json(5)</a></p>
</div>
-<p id="footer">npm-init &mdash; npm@1.3.5</p>
+<p id="footer">npm-init &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-install.html b/deps/npm/html/doc/api/npm-install.html
index 07a1f7ed1..f2d4bd3c0 100644
--- a/deps/npm/html/doc/api/npm-install.html
+++ b/deps/npm/html/doc/api/npm-install.html
@@ -25,7 +25,7 @@ the name of a package to be installed.</p>
<p>Finally, &#39;callback&#39; 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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-install &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-link.html b/deps/npm/html/doc/api/npm-link.html
index 90f43c5f6..d49e9f6ab 100644
--- a/deps/npm/html/doc/api/npm-link.html
+++ b/deps/npm/html/doc/api/npm-link.html
@@ -39,7 +39,7 @@ npm.commands.link(&#39;redis&#39;, cb) # link-install the package</code></pre>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-link &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-load.html b/deps/npm/html/doc/api/npm-load.html
index 33d22a952..51cd332f8 100644
--- a/deps/npm/html/doc/api/npm-load.html
+++ b/deps/npm/html/doc/api/npm-load.html
@@ -32,7 +32,7 @@ config object.</p>
<p>For a list of all the available command-line configs, see <code>npm help config</code></p>
</div>
-<p id="footer">npm-load &mdash; npm@1.3.5</p>
+<p id="footer">npm-load &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-ls.html b/deps/npm/html/doc/api/npm-ls.html
index 59836b5a4..c159e36f1 100644
--- a/deps/npm/html/doc/api/npm-ls.html
+++ b/deps/npm/html/doc/api/npm-ls.html
@@ -59,7 +59,7 @@ project.</p>
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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-ls &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-outdated.html b/deps/npm/html/doc/api/npm-outdated.html
index 41ee463a1..6a48fb7b0 100644
--- a/deps/npm/html/doc/api/npm-outdated.html
+++ b/deps/npm/html/doc/api/npm-outdated.html
@@ -19,7 +19,7 @@ currently outdated.</p>
<p>If the &#39;packages&#39; parameter is left out, npm will check all packages.</p>
</div>
-<p id="footer">npm-outdated &mdash; npm@1.3.5</p>
+<p id="footer">npm-outdated &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-owner.html b/deps/npm/html/doc/api/npm-owner.html
index 93cfc0b25..a10a78e82 100644
--- a/deps/npm/html/doc/api/npm-owner.html
+++ b/deps/npm/html/doc/api/npm-owner.html
@@ -34,7 +34,7 @@ that is not implemented at this time.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-owner &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-pack.html b/deps/npm/html/doc/api/npm-pack.html
index 9fe6087e5..756b736f5 100644
--- a/deps/npm/html/doc/api/npm-pack.html
+++ b/deps/npm/html/doc/api/npm-pack.html
@@ -25,7 +25,7 @@ overwritten the second time.</p>
<p>If no arguments are supplied, then npm packs the current package folder.</p>
</div>
-<p id="footer">npm-pack &mdash; npm@1.3.5</p>
+<p id="footer">npm-pack &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-prefix.html b/deps/npm/html/doc/api/npm-prefix.html
index f3ece8bf4..b8cbc89db 100644
--- a/deps/npm/html/doc/api/npm-prefix.html
+++ b/deps/npm/html/doc/api/npm-prefix.html
@@ -21,7 +21,7 @@
<p>This function is not useful programmatically</p>
</div>
-<p id="footer">npm-prefix &mdash; npm@1.3.5</p>
+<p id="footer">npm-prefix &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-prune.html b/deps/npm/html/doc/api/npm-prune.html
index 9677d19f3..7683db720 100644
--- a/deps/npm/html/doc/api/npm-prune.html
+++ b/deps/npm/html/doc/api/npm-prune.html
@@ -23,7 +23,7 @@
<p>Extraneous packages are packages that are not listed on the parent
package&#39;s dependencies list.</p>
</div>
-<p id="footer">npm-prune &mdash; npm@1.3.5</p>
+<p id="footer">npm-prune &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-publish.html b/deps/npm/html/doc/api/npm-publish.html
index 2007a4a9e..569f70022 100644
--- a/deps/npm/html/doc/api/npm-publish.html
+++ b/deps/npm/html/doc/api/npm-publish.html
@@ -32,7 +32,7 @@ the registry. Overwrites when the &quot;force&quot; environment variable is set
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-publish &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-rebuild.html b/deps/npm/html/doc/api/npm-rebuild.html
index 624a2e661..e58abb2dc 100644
--- a/deps/npm/html/doc/api/npm-rebuild.html
+++ b/deps/npm/html/doc/api/npm-rebuild.html
@@ -22,7 +22,7 @@ the new binary. If no &#39;packages&#39; parameter is specify, every package wil
<p>See <code>npm help build</code></p>
</div>
-<p id="footer">npm-rebuild &mdash; npm@1.3.5</p>
+<p id="footer">npm-rebuild &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-restart.html b/deps/npm/html/doc/api/npm-restart.html
index 32516ada9..1f9d8972d 100644
--- a/deps/npm/html/doc/api/npm-restart.html
+++ b/deps/npm/html/doc/api/npm-restart.html
@@ -27,7 +27,7 @@ in the <code>packages</code> parameter.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-restart &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-root.html b/deps/npm/html/doc/api/npm-root.html
index 65ccffeb8..047f05f4c 100644
--- a/deps/npm/html/doc/api/npm-root.html
+++ b/deps/npm/html/doc/api/npm-root.html
@@ -21,7 +21,7 @@
<p>This function is not useful programmatically.</p>
</div>
-<p id="footer">npm-root &mdash; npm@1.3.5</p>
+<p id="footer">npm-root &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-run-script.html b/deps/npm/html/doc/api/npm-run-script.html
index b47e7d0a8..e62076569 100644
--- a/deps/npm/html/doc/api/npm-run-script.html
+++ b/deps/npm/html/doc/api/npm-run-script.html
@@ -29,7 +29,7 @@ assumed to be the command to run. All other elements are ignored.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-run-script &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-search.html b/deps/npm/html/doc/api/npm-search.html
index 1c8379013..9c6ae169a 100644
--- a/deps/npm/html/doc/api/npm-search.html
+++ b/deps/npm/html/doc/api/npm-search.html
@@ -32,7 +32,7 @@ excluded term (the &quot;searchexclude&quot; config). The search is case insensi
and doesn&#39;t try to read your mind (it doesn&#39;t do any verb tense matching or the
like).</p>
</div>
-<p id="footer">npm-search &mdash; npm@1.3.5</p>
+<p id="footer">npm-search &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-shrinkwrap.html b/deps/npm/html/doc/api/npm-shrinkwrap.html
index 88cff744e..ed09c298e 100644
--- a/deps/npm/html/doc/api/npm-shrinkwrap.html
+++ b/deps/npm/html/doc/api/npm-shrinkwrap.html
@@ -26,7 +26,7 @@ but the shrinkwrap file will still be written.</p>
<p>Finally, &#39;callback&#39; is a function that will be called when the shrinkwrap has
been saved.</p>
</div>
-<p id="footer">npm-shrinkwrap &mdash; npm@1.3.5</p>
+<p id="footer">npm-shrinkwrap &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-start.html b/deps/npm/html/doc/api/npm-start.html
index 9af35bf65..e2d51540e 100644
--- a/deps/npm/html/doc/api/npm-start.html
+++ b/deps/npm/html/doc/api/npm-start.html
@@ -19,7 +19,7 @@
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-start &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-stop.html b/deps/npm/html/doc/api/npm-stop.html
index 961821da3..9c34fafa6 100644
--- a/deps/npm/html/doc/api/npm-stop.html
+++ b/deps/npm/html/doc/api/npm-stop.html
@@ -19,7 +19,7 @@
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-stop &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-submodule.html b/deps/npm/html/doc/api/npm-submodule.html
index 0d1732b51..cea266f83 100644
--- a/deps/npm/html/doc/api/npm-submodule.html
+++ b/deps/npm/html/doc/api/npm-submodule.html
@@ -33,7 +33,7 @@ dependencies into the submodule folder.</p>
<ul><li>npm help json</li><li>git help submodule</li></ul>
</div>
-<p id="footer">npm-submodule &mdash; npm@1.3.5</p>
+<p id="footer">npm-submodule &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-tag.html b/deps/npm/html/doc/api/npm-tag.html
index 372e56be1..3b54b73b4 100644
--- a/deps/npm/html/doc/api/npm-tag.html
+++ b/deps/npm/html/doc/api/npm-tag.html
@@ -29,7 +29,7 @@ parameter is missing or falsey (empty), the default froom the config will be
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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-tag &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-test.html b/deps/npm/html/doc/api/npm-test.html
index e854cc61b..c0bcbe968 100644
--- a/deps/npm/html/doc/api/npm-test.html
+++ b/deps/npm/html/doc/api/npm-test.html
@@ -22,7 +22,7 @@ true.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-test &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-uninstall.html b/deps/npm/html/doc/api/npm-uninstall.html
index 8e1f3259c..74d52c1c9 100644
--- a/deps/npm/html/doc/api/npm-uninstall.html
+++ b/deps/npm/html/doc/api/npm-uninstall.html
@@ -22,7 +22,7 @@ the name of a package to be uninstalled.</p>
<p>Finally, &#39;callback&#39; 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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-uninstall &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-unpublish.html b/deps/npm/html/doc/api/npm-unpublish.html
index 69fb8d9b2..c58e93871 100644
--- a/deps/npm/html/doc/api/npm-unpublish.html
+++ b/deps/npm/html/doc/api/npm-unpublish.html
@@ -26,7 +26,7 @@ is what is meant.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-unpublish &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-update.html b/deps/npm/html/doc/api/npm-update.html
index d8572a5f4..34285840a 100644
--- a/deps/npm/html/doc/api/npm-update.html
+++ b/deps/npm/html/doc/api/npm-update.html
@@ -18,7 +18,7 @@
<p>The &#39;packages&#39; argument is an array of packages to update. The &#39;callback&#39; parameter will be called when done or when an error occurs.</p>
</div>
-<p id="footer">npm-update &mdash; npm@1.3.5</p>
+<p id="footer">npm-update &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-version.html b/deps/npm/html/doc/api/npm-version.html
index 78a8727a2..d5369e670 100644
--- a/deps/npm/html/doc/api/npm-version.html
+++ b/deps/npm/html/doc/api/npm-version.html
@@ -24,7 +24,7 @@ fail if the repo is not clean.</p>
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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-version &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-view.html b/deps/npm/html/doc/api/npm-view.html
index 5299b1a5d..d0c6f0b56 100644
--- a/deps/npm/html/doc/api/npm-view.html
+++ b/deps/npm/html/doc/api/npm-view.html
@@ -99,7 +99,7 @@ the field name.</p>
<p>corresponding to the list of fields selected.</p>
</div>
-<p id="footer">npm-view &mdash; npm@1.3.5</p>
+<p id="footer">npm-view &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm-whoami.html b/deps/npm/html/doc/api/npm-whoami.html
index ca4be1a85..04d4bd913 100644
--- a/deps/npm/html/doc/api/npm-whoami.html
+++ b/deps/npm/html/doc/api/npm-whoami.html
@@ -21,7 +21,7 @@
<p>This function is not useful programmatically</p>
</div>
-<p id="footer">npm-whoami &mdash; npm@1.3.5</p>
+<p id="footer">npm-whoami &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/api/npm.html b/deps/npm/html/doc/api/npm.html
index 25d9c5ecb..97e1d3c68 100644
--- a/deps/npm/html/doc/api/npm.html
+++ b/deps/npm/html/doc/api/npm.html
@@ -24,7 +24,7 @@ npm.load([configObject,] function (er, npm) {
<h2 id="VERSION">VERSION</h2>
-<p>1.3.5</p>
+<p>1.3.6</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
@@ -92,7 +92,7 @@ method names. Use the <code>npm.deref</code> method to find the real name.</p>
<pre><code>var cmd = npm.deref(&quot;unp&quot;) // cmd === &quot;unpublish&quot;</code></pre>
</div>
-<p id="footer">npm &mdash; npm@1.3.5</p>
+<p id="footer">npm &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-adduser.html b/deps/npm/html/doc/cli/npm-adduser.html
index a1ecc854a..ff58a6072 100644
--- a/deps/npm/html/doc/cli/npm-adduser.html
+++ b/deps/npm/html/doc/cli/npm-adduser.html
@@ -39,7 +39,7 @@ authorize on a new machine.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-adduser &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-bin.html b/deps/npm/html/doc/cli/npm-bin.html
index 7bbfee699..d686e65a0 100644
--- a/deps/npm/html/doc/cli/npm-bin.html
+++ b/deps/npm/html/doc/cli/npm-bin.html
@@ -20,7 +20,7 @@
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-bin &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-bugs.html b/deps/npm/html/doc/cli/npm-bugs.html
index c456bf22d..5635e6736 100644
--- a/deps/npm/html/doc/cli/npm-bugs.html
+++ b/deps/npm/html/doc/cli/npm-bugs.html
@@ -36,7 +36,7 @@ config param.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-bugs &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html
index 211a78dac..60b3d7d88 100644
--- a/deps/npm/html/doc/cli/npm-build.html
+++ b/deps/npm/html/doc/cli/npm-build.html
@@ -25,7 +25,7 @@ A folder containing a <code>package.json</code> file in its root.</li></ul>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-build &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-bundle.html b/deps/npm/html/doc/cli/npm-bundle.html
index 06c537f05..d16fe378b 100644
--- a/deps/npm/html/doc/cli/npm-bundle.html
+++ b/deps/npm/html/doc/cli/npm-bundle.html
@@ -20,7 +20,7 @@ install packages into the local space.</p>
<ul><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
</div>
-<p id="footer">npm-bundle &mdash; npm@1.3.5</p>
+<p id="footer">npm-bundle &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-cache.html b/deps/npm/html/doc/cli/npm-cache.html
index 21acd12cd..7409200f0 100644
--- a/deps/npm/html/doc/cli/npm-cache.html
+++ b/deps/npm/html/doc/cli/npm-cache.html
@@ -66,7 +66,7 @@ they do not make an HTTP request to the registry.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-cache &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-completion.html b/deps/npm/html/doc/cli/npm-completion.html
index 7573c720a..2731771ad 100644
--- a/deps/npm/html/doc/cli/npm-completion.html
+++ b/deps/npm/html/doc/cli/npm-completion.html
@@ -33,7 +33,7 @@ completions based on the arguments.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-completion &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html
index 04ed98c2f..30654668b 100644
--- a/deps/npm/html/doc/cli/npm-config.html
+++ b/deps/npm/html/doc/cli/npm-config.html
@@ -72,7 +72,7 @@ global config.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-config &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-dedupe.html b/deps/npm/html/doc/cli/npm-dedupe.html
index 8a98d4499..bce6939c0 100644
--- a/deps/npm/html/doc/cli/npm-dedupe.html
+++ b/deps/npm/html/doc/cli/npm-dedupe.html
@@ -57,7 +57,7 @@ registry.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-dedupe &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html
index 4516aafa8..ebd76f15e 100644
--- a/deps/npm/html/doc/cli/npm-deprecate.html
+++ b/deps/npm/html/doc/cli/npm-deprecate.html
@@ -31,7 +31,7 @@ something like this:</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-deprecate &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html
index 650f6ad05..5a9bb118b 100644
--- a/deps/npm/html/doc/cli/npm-docs.html
+++ b/deps/npm/html/doc/cli/npm-docs.html
@@ -37,7 +37,7 @@ config param.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-docs &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-edit.html b/deps/npm/html/doc/cli/npm-edit.html
index d07495c4b..d5087cd22 100644
--- a/deps/npm/html/doc/cli/npm-edit.html
+++ b/deps/npm/html/doc/cli/npm-edit.html
@@ -37,7 +37,7 @@ or <code>&quot;notepad&quot;</code> on Windows.</li><li>Type: path</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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-edit &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-explore.html b/deps/npm/html/doc/cli/npm-explore.html
index 6378011c2..962563b1b 100644
--- a/deps/npm/html/doc/cli/npm-explore.html
+++ b/deps/npm/html/doc/cli/npm-explore.html
@@ -40,7 +40,7 @@ Windows</li><li>Type: path</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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-explore &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-help-search.html b/deps/npm/html/doc/cli/npm-help-search.html
index ae15b4cb0..c7fd2b296 100644
--- a/deps/npm/html/doc/cli/npm-help-search.html
+++ b/deps/npm/html/doc/cli/npm-help-search.html
@@ -38,7 +38,7 @@ where the terms were found in the documentation.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-help-search &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html
index dfa160d89..a65658ebb 100644
--- a/deps/npm/html/doc/cli/npm-help.html
+++ b/deps/npm/html/doc/cli/npm-help.html
@@ -36,7 +36,7 @@ matches are equivalent to specifying a topic name.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-help &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html
index 68bab3956..8f2c007cd 100644
--- a/deps/npm/html/doc/cli/npm-init.html
+++ b/deps/npm/html/doc/cli/npm-init.html
@@ -29,7 +29,7 @@ without a really good reason to do so.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-init &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-install.html b/deps/npm/html/doc/cli/npm-install.html
index ab1fd0a69..0213babe3 100644
--- a/deps/npm/html/doc/cli/npm-install.html
+++ b/deps/npm/html/doc/cli/npm-install.html
@@ -141,7 +141,7 @@ affects a real use-case, it will be investigated.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-install &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-link.html b/deps/npm/html/doc/cli/npm-link.html
index cac81da45..86eb8d121 100644
--- a/deps/npm/html/doc/cli/npm-link.html
+++ b/deps/npm/html/doc/cli/npm-link.html
@@ -61,7 +61,7 @@ installation target into your project&#39;s <code>node_modules</code> folder.</p
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-link &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-ls.html b/deps/npm/html/doc/cli/npm-ls.html
index 066f6af51..108261ae1 100644
--- a/deps/npm/html/doc/cli/npm-ls.html
+++ b/deps/npm/html/doc/cli/npm-ls.html
@@ -25,7 +25,7 @@ limit the results to only the paths to the packages named. Note that
nested packages will <em>also</em> show the paths to the specified packages.
For example, running <code>npm ls promzard</code> in npm&#39;s source tree will show:</p>
-<pre><code>npm@1.3.5 /path/to/npm
+<pre><code>npm@1.3.6 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5</code></pre>
@@ -68,7 +68,7 @@ project.</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="../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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-ls &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html
index 2597125f2..2bb3d81b3 100644
--- a/deps/npm/html/doc/cli/npm-outdated.html
+++ b/deps/npm/html/doc/cli/npm-outdated.html
@@ -21,7 +21,7 @@ packages are currently outdated.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-outdated &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html
index cdf5fc2ea..8cf0b1ca8 100644
--- a/deps/npm/html/doc/cli/npm-owner.html
+++ b/deps/npm/html/doc/cli/npm-owner.html
@@ -34,7 +34,7 @@ that is not implemented at this time.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-owner &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html
index 9c495743f..40568ce76 100644
--- a/deps/npm/html/doc/cli/npm-pack.html
+++ b/deps/npm/html/doc/cli/npm-pack.html
@@ -29,7 +29,7 @@ overwritten the second time.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-pack &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html
index 9c8898e75..fb843d72e 100644
--- a/deps/npm/html/doc/cli/npm-prefix.html
+++ b/deps/npm/html/doc/cli/npm-prefix.html
@@ -20,7 +20,7 @@
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-prefix &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html
index 4ef2892ca..13364802c 100644
--- a/deps/npm/html/doc/cli/npm-prune.html
+++ b/deps/npm/html/doc/cli/npm-prune.html
@@ -25,7 +25,7 @@ package&#39;s dependencies list.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-prune &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html
index 468cec254..20f21f346 100644
--- a/deps/npm/html/doc/cli/npm-publish.html
+++ b/deps/npm/html/doc/cli/npm-publish.html
@@ -29,7 +29,7 @@ the registry. Overwrites when the &quot;--force&quot; flag is set.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-publish &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html
index 9403d2a77..7c2ecc5dd 100644
--- a/deps/npm/html/doc/cli/npm-rebuild.html
+++ b/deps/npm/html/doc/cli/npm-rebuild.html
@@ -25,7 +25,7 @@ the new binary.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-rebuild &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html
index 634049a21..cf379d9ee 100644
--- a/deps/npm/html/doc/cli/npm-restart.html
+++ b/deps/npm/html/doc/cli/npm-restart.html
@@ -24,7 +24,7 @@ the &quot;start&quot; script.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-restart &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-rm.html b/deps/npm/html/doc/cli/npm-rm.html
index 5b043c1ff..be0da522b 100644
--- a/deps/npm/html/doc/cli/npm-rm.html
+++ b/deps/npm/html/doc/cli/npm-rm.html
@@ -22,7 +22,7 @@ on its behalf.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-rm &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html
index 58a70f6ee..7d74933c4 100644
--- a/deps/npm/html/doc/cli/npm-root.html
+++ b/deps/npm/html/doc/cli/npm-root.html
@@ -20,7 +20,7 @@
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-root &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html
index 4c500614b..3a74e0e14 100644
--- a/deps/npm/html/doc/cli/npm-run-script.html
+++ b/deps/npm/html/doc/cli/npm-run-script.html
@@ -23,7 +23,7 @@ called directly, as well.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-run-script &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html
index a0c957d12..f44f74fec 100644
--- a/deps/npm/html/doc/cli/npm-search.html
+++ b/deps/npm/html/doc/cli/npm-search.html
@@ -24,7 +24,7 @@ expression characters must be escaped or quoted in most shells.)</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-search &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html
index 7b7078c28..4089a9daf 100644
--- a/deps/npm/html/doc/cli/npm-shrinkwrap.html
+++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html
@@ -183,7 +183,7 @@ contents rather than versions.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-shrinkwrap &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html
index fcf110539..5ed45d31d 100644
--- a/deps/npm/html/doc/cli/npm-star.html
+++ b/deps/npm/html/doc/cli/npm-star.html
@@ -26,7 +26,7 @@ a vaguely positive way to show that you care.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-star &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html
index 521859b5b..72d68037d 100644
--- a/deps/npm/html/doc/cli/npm-stars.html
+++ b/deps/npm/html/doc/cli/npm-stars.html
@@ -25,7 +25,7 @@ you will most certainly enjoy this command.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-stars &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html
index 20b3ea48e..37f903962 100644
--- a/deps/npm/html/doc/cli/npm-start.html
+++ b/deps/npm/html/doc/cli/npm-start.html
@@ -20,7 +20,7 @@
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-start &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html
index ebf4a19f2..8ab1518d4 100644
--- a/deps/npm/html/doc/cli/npm-stop.html
+++ b/deps/npm/html/doc/cli/npm-stop.html
@@ -20,7 +20,7 @@
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-stop &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-submodule.html b/deps/npm/html/doc/cli/npm-submodule.html
index 598b6799d..f53682e09 100644
--- a/deps/npm/html/doc/cli/npm-submodule.html
+++ b/deps/npm/html/doc/cli/npm-submodule.html
@@ -33,7 +33,7 @@ dependencies into the submodule folder.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-submodule &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-tag.html b/deps/npm/html/doc/cli/npm-tag.html
index 077c47ff1..859ad7fa7 100644
--- a/deps/npm/html/doc/cli/npm-tag.html
+++ b/deps/npm/html/doc/cli/npm-tag.html
@@ -21,7 +21,7 @@
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-tag &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html
index 6ed0f73e0..c6f621d1a 100644
--- a/deps/npm/html/doc/cli/npm-test.html
+++ b/deps/npm/html/doc/cli/npm-test.html
@@ -23,7 +23,7 @@ true.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-test &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html
index daa2b3e41..3fb5e03c6 100644
--- a/deps/npm/html/doc/cli/npm-uninstall.html
+++ b/deps/npm/html/doc/cli/npm-uninstall.html
@@ -22,7 +22,7 @@ on its behalf.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-uninstall &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html
index ec1622557..0648227e0 100644
--- a/deps/npm/html/doc/cli/npm-unpublish.html
+++ b/deps/npm/html/doc/cli/npm-unpublish.html
@@ -34,7 +34,7 @@ the root package entry is removed from the registry entirely.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-unpublish &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html
index 645ad96d5..c9195e6c1 100644
--- a/deps/npm/html/doc/cli/npm-update.html
+++ b/deps/npm/html/doc/cli/npm-update.html
@@ -26,7 +26,7 @@ If no package name is specified, all packages in the specified location (global
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-update &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html
index b6839a594..79c38a286 100644
--- a/deps/npm/html/doc/cli/npm-version.html
+++ b/deps/npm/html/doc/cli/npm-version.html
@@ -49,7 +49,7 @@ Enter passphrase:</code></pre>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-version &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html
index 1665ca7d7..ea9733ce4 100644
--- a/deps/npm/html/doc/cli/npm-view.html
+++ b/deps/npm/html/doc/cli/npm-view.html
@@ -90,7 +90,7 @@ the field name.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-view &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html
index fa18ced80..f6d547a47 100644
--- a/deps/npm/html/doc/cli/npm-whoami.html
+++ b/deps/npm/html/doc/cli/npm-whoami.html
@@ -20,7 +20,7 @@
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-whoami &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html
index 6b7245e6f..115d40ded 100644
--- a/deps/npm/html/doc/cli/npm.html
+++ b/deps/npm/html/doc/cli/npm.html
@@ -14,7 +14,7 @@
<h2 id="VERSION">VERSION</h2>
-<p>1.3.5</p>
+<p>1.3.6</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
@@ -135,7 +135,7 @@ will no doubt tell you to put the output in a gist or email.</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 &mdash; npm@1.3.5</p>
+<p id="footer">npm &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/files/npm-folders.html b/deps/npm/html/doc/files/npm-folders.html
index 0e9097680..0d49c4e74 100644
--- a/deps/npm/html/doc/files/npm-folders.html
+++ b/deps/npm/html/doc/files/npm-folders.html
@@ -205,7 +205,7 @@ cannot be found elsewhere. See <code><a href="../files/package.json.html">packa
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-folders &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html
index 0e9097680..0d49c4e74 100644
--- a/deps/npm/html/doc/files/npm-global.html
+++ b/deps/npm/html/doc/files/npm-global.html
@@ -205,7 +205,7 @@ cannot be found elsewhere. See <code><a href="../files/package.json.html">packa
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-folders &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html
index b5917e48d..5cc92407b 100644
--- a/deps/npm/html/doc/files/npm-json.html
+++ b/deps/npm/html/doc/files/npm-json.html
@@ -546,7 +546,7 @@ overridden.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">package.json &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html
index c75fc57d0..d616bf99b 100644
--- a/deps/npm/html/doc/files/npmrc.html
+++ b/deps/npm/html/doc/files/npmrc.html
@@ -59,7 +59,7 @@ manner.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npmrc &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html
index b5917e48d..5cc92407b 100644
--- a/deps/npm/html/doc/files/package.json.html
+++ b/deps/npm/html/doc/files/package.json.html
@@ -546,7 +546,7 @@ overridden.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">package.json &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html
index f0493c37e..2517c0b7c 100644
--- a/deps/npm/html/doc/index.html
+++ b/deps/npm/html/doc/index.html
@@ -408,7 +408,7 @@
<p>The semantic versioner for npm</p>
</div>
-<p id="footer">npm-index &mdash; npm@1.3.5</p>
+<p id="footer">npm-index &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html
index c8794fb98..962fd7357 100644
--- a/deps/npm/html/doc/misc/npm-coding-style.html
+++ b/deps/npm/html/doc/misc/npm-coding-style.html
@@ -182,7 +182,7 @@ set to anything.&quot;</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-coding-style &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html
index d20a08616..759cb106a 100644
--- a/deps/npm/html/doc/misc/npm-config.html
+++ b/deps/npm/html/doc/misc/npm-config.html
@@ -717,7 +717,7 @@ then answer &quot;no&quot; to any prompt.</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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-config &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html
index 75d1aa77e..5555fc6d2 100644
--- a/deps/npm/html/doc/misc/npm-developers.html
+++ b/deps/npm/html/doc/misc/npm-developers.html
@@ -174,7 +174,7 @@ from a fresh checkout.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-developers &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html
index 8e7599e37..21a8989f3 100644
--- a/deps/npm/html/doc/misc/npm-disputes.html
+++ b/deps/npm/html/doc/misc/npm-disputes.html
@@ -91,7 +91,7 @@ things into it.</li></ol>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-disputes &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/misc/npm-faq.html b/deps/npm/html/doc/misc/npm-faq.html
index 4eecae159..ef4c6fe26 100644
--- a/deps/npm/html/doc/misc/npm-faq.html
+++ b/deps/npm/html/doc/misc/npm-faq.html
@@ -340,7 +340,7 @@ There is not sufficient need to impose namespace rules on everyone.</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-faq &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html
index f6cff42d0..ab25fa5fa 100644
--- a/deps/npm/html/doc/misc/npm-index.html
+++ b/deps/npm/html/doc/misc/npm-index.html
@@ -408,7 +408,7 @@
<p>The semantic versioner for npm</p>
</div>
-<p id="footer">npm-index &mdash; npm@1.3.5</p>
+<p id="footer">npm-index &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html
index f8672b1d3..9c6c0c397 100644
--- a/deps/npm/html/doc/misc/npm-registry.html
+++ b/deps/npm/html/doc/misc/npm-registry.html
@@ -96,7 +96,7 @@ ask for help on the <a href="mailto:npm-@googlegroups.com">npm-@googlegroups.com
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-registry &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html
index 0ece39d78..d0343f9a7 100644
--- a/deps/npm/html/doc/misc/npm-scripts.html
+++ b/deps/npm/html/doc/misc/npm-scripts.html
@@ -223,7 +223,7 @@ the user will sudo the npm command in question.</li></ul>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">npm-scripts &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html
index 45a2fbff6..0b0299346 100644
--- a/deps/npm/html/doc/misc/removing-npm.html
+++ b/deps/npm/html/doc/misc/removing-npm.html
@@ -58,7 +58,7 @@ modules. To track those down, you can do the following:</p>
<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 &mdash; npm@1.3.5</p>
+<p id="footer">removing-npm &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html
index a209b9039..502c8490d 100644
--- a/deps/npm/html/doc/misc/semver.html
+++ b/deps/npm/html/doc/misc/semver.html
@@ -94,7 +94,7 @@ in descending order when passed to Array.sort().</li></ul>
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 &mdash; npm@1.3.5</p>
+<p id="footer">semver &mdash; npm@1.3.6</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js
index 2d2148b1a..3739968f6 100644
--- a/deps/npm/lib/cache.js
+++ b/deps/npm/lib/cache.js
@@ -1107,9 +1107,7 @@ function addLocalDirectory (p, name, shasum, cb) {
// tar it to the proper place, and add the cache tar
if (p.indexOf(npm.cache) === 0) return cb(new Error(
"Adding a cache directory to the cache will make the world implode."))
- var strict = p.indexOf(npm.tmp) !== 0
- && p.indexOf(npm.cache) !== 0
- readJson(path.join(p, "package.json"), strict, function (er, data) {
+ readJson(path.join(p, "package.json"), false, function (er, data) {
er = needName(er, data)
er = needVersion(er, data)
if (er) return cb(er)
@@ -1124,7 +1122,7 @@ function addLocalDirectory (p, name, shasum, cb) {
getCacheStat(function (er, cs) {
mkdir(path.dirname(tgz), function (er, made) {
if (er) return cb(er)
- tar.pack(tgz, p, data, strict, function (er) {
+ tar.pack(tgz, p, data, false, function (er) {
if (er) {
log.error( "addLocalDirectory", "Could not pack %j to %j"
, p, tgz )
diff --git a/deps/npm/lib/utils/error-handler.js b/deps/npm/lib/utils/error-handler.js
index 32b050643..8637592ab 100644
--- a/deps/npm/lib/utils/error-handler.js
+++ b/deps/npm/lib/utils/error-handler.js
@@ -224,7 +224,9 @@ function errorHandler (er) {
log.error("peerinvalid", [er.message].concat(peerErrors).join("\n"))
break
+ case "ECONNRESET":
case "ENOTFOUND":
+ case "ETIMEDOUT":
log.error("network", [er.message
,"This is most likely not a problem with npm itself"
,"and is related to network connectivity."
diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1
index 79a1a810f..50802022d 100644
--- a/deps/npm/man/man1/npm-ls.1
+++ b/deps/npm/man/man1/npm-ls.1
@@ -29,7 +29,7 @@ For example, running \fBnpm ls promzard\fR in npm\'s source tree will show:
.IP "" 4
.
.nf
-npm@1.3.5 /path/to/npm
+npm@1.3.6 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.
diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1
index 092e87cd3..ac03f7d2b 100644
--- a/deps/npm/man/man1/npm.1
+++ b/deps/npm/man/man1/npm.1
@@ -14,7 +14,7 @@ npm <command> [args]
.fi
.
.SH "VERSION"
-1.3.5
+1.3.6
.
.SH "DESCRIPTION"
npm is the package manager for the Node JavaScript platform\. It puts
diff --git a/deps/npm/man/man3/npm.3 b/deps/npm/man/man3/npm.3
index 2fcc572c8..53ca7e804 100644
--- a/deps/npm/man/man3/npm.3
+++ b/deps/npm/man/man3/npm.3
@@ -21,7 +21,7 @@ npm\.load([configObject,] function (er, npm) {
.fi
.
.SH "VERSION"
-1.3.5
+1.3.6
.
.SH "DESCRIPTION"
This is the API documentation for npm\.
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/sha/node_modules/readable-stream/LICENSE
new file mode 100644
index 000000000..0c44ae716
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/LICENSE
@@ -0,0 +1,27 @@
+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.
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/README.md b/deps/npm/node_modules/sha/node_modules/readable-stream/README.md
new file mode 100644
index 000000000..be976683e
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/README.md
@@ -0,0 +1,768 @@
+# readable-stream
+
+A new class of streams for Node.js
+
+This module provides the new Stream base classes introduced in Node
+v0.10, for use in Node v0.8. You can use it to have programs that
+have to work with node v0.8, while being forward-compatible for v0.10
+and beyond. When you drop support for v0.8, you can remove this
+module, and only use the native streams.
+
+This is almost exactly the same codebase as appears in Node v0.10.
+However:
+
+1. The exported object is actually the Readable class. Decorating the
+ native `stream` module would be global pollution.
+2. In v0.10, you can safely use `base64` as an argument to
+ `setEncoding` in Readable streams. However, in v0.8, the
+ StringDecoder class has no `end()` method, which is problematic for
+ Base64. So, don't use that, because it'll break and be weird.
+
+Other than that, the API is the same as `require('stream')` in v0.10,
+so the API docs are reproduced below.
+
+----------
+
+ Stability: 2 - Unstable
+
+A stream is an abstract interface implemented by various objects in
+Node. For example a request to an HTTP server is a stream, as is
+stdout. Streams are readable, writable, or both. All streams are
+instances of [EventEmitter][]
+
+You can load the Stream base classes by doing `require('stream')`.
+There are base classes provided for Readable streams, Writable
+streams, Duplex streams, and Transform streams.
+
+## Compatibility
+
+In earlier versions of Node, the Readable stream interface was
+simpler, but also less powerful and less useful.
+
+* Rather than waiting for you to call the `read()` method, `'data'`
+ events would start emitting immediately. If you needed to do some
+ I/O to decide how to handle data, then you had to store the chunks
+ in some kind of buffer so that they would not be lost.
+* The `pause()` method was advisory, rather than guaranteed. This
+ meant that you still had to be prepared to receive `'data'` events
+ even when the stream was in a paused state.
+
+In Node v0.10, the Readable class described below was added. For
+backwards compatibility with older Node programs, Readable streams
+switch into "old mode" when a `'data'` event handler is added, or when
+the `pause()` or `resume()` methods are called. The effect is that,
+even if you are not using the new `read()` method and `'readable'`
+event, you no longer have to worry about losing `'data'` chunks.
+
+Most programs will continue to function normally. However, this
+introduces an edge case in the following conditions:
+
+* No `'data'` event handler is added.
+* The `pause()` and `resume()` methods are never called.
+
+For example, consider the following code:
+
+```javascript
+// WARNING! BROKEN!
+net.createServer(function(socket) {
+
+ // we add an 'end' method, but never consume the data
+ socket.on('end', function() {
+ // It will never get here.
+ socket.end('I got your message (but didnt read it)\n');
+ });
+
+}).listen(1337);
+```
+
+In versions of node prior to v0.10, the incoming message data would be
+simply discarded. However, in Node v0.10 and beyond, the socket will
+remain paused forever.
+
+The workaround in this situation is to call the `resume()` method to
+trigger "old mode" behavior:
+
+```javascript
+// Workaround
+net.createServer(function(socket) {
+
+ socket.on('end', function() {
+ socket.end('I got your message (but didnt read it)\n');
+ });
+
+ // start the flow of data, discarding it.
+ socket.resume();
+
+}).listen(1337);
+```
+
+In addition to new Readable streams switching into old-mode, pre-v0.10
+style streams can be wrapped in a Readable class using the `wrap()`
+method.
+
+## Class: stream.Readable
+
+<!--type=class-->
+
+A `Readable Stream` has the following methods, members, and events.
+
+Note that `stream.Readable` is an abstract class designed to be
+extended with an underlying implementation of the `_read(size)`
+method. (See below.)
+
+### new stream.Readable([options])
+
+* `options` {Object}
+ * `highWaterMark` {Number} The maximum number of bytes to store in
+ the internal buffer before ceasing to read from the underlying
+ resource. Default=16kb
+ * `encoding` {String} If specified, then buffers will be decoded to
+ strings using the specified encoding. Default=null
+ * `objectMode` {Boolean} Whether this stream should behave
+ as a stream of objects. Meaning that stream.read(n) returns
+ a single value instead of a Buffer of size n
+
+In classes that extend the Readable class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+### readable.\_read(size)
+
+* `size` {Number} Number of bytes to read asynchronously
+
+Note: **This function should NOT be called directly.** It should be
+implemented by child classes, and called by the internal Readable
+class methods only.
+
+All Readable stream implementations must provide a `_read` method
+to fetch data from the underlying resource.
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs. However, you **are** expected to override this method in
+your own extension classes.
+
+When data is available, put it into the read queue by calling
+`readable.push(chunk)`. If `push` returns false, then you should stop
+reading. When `_read` is called again, you should start pushing more
+data.
+
+The `size` argument is advisory. Implementations where a "read" is a
+single call that returns data can use this to know how much data to
+fetch. Implementations where that is not relevant, such as TCP or
+TLS, may ignore this argument, and simply provide data whenever it
+becomes available. There is no need, for example to "wait" until
+`size` bytes are available before calling `stream.push(chunk)`.
+
+### readable.push(chunk)
+
+* `chunk` {Buffer | null | String} Chunk of data to push into the read queue
+* return {Boolean} Whether or not more pushes should be performed
+
+Note: **This function should be called by Readable implementors, NOT
+by consumers of Readable subclasses.** The `_read()` function will not
+be called again until at least one `push(chunk)` call is made. If no
+data is available, then you MAY call `push('')` (an empty string) to
+allow a future `_read` call, without adding any data to the queue.
+
+The `Readable` class works by putting data into a read queue to be
+pulled out later by calling the `read()` method when the `'readable'`
+event fires.
+
+The `push()` method will explicitly insert some data into the read
+queue. If it is called with `null` then it will signal the end of the
+data.
+
+In some cases, you may be wrapping a lower-level source which has some
+sort of pause/resume mechanism, and a data callback. In those cases,
+you could wrap the low-level source object by doing something like
+this:
+
+```javascript
+// source is an object with readStop() and readStart() methods,
+// and an `ondata` member that gets called when it has data, and
+// an `onend` member that gets called when the data is over.
+
+var stream = new Readable();
+
+source.ondata = function(chunk) {
+ // if push() returns false, then we need to stop reading from source
+ if (!stream.push(chunk))
+ source.readStop();
+};
+
+source.onend = function() {
+ stream.push(null);
+};
+
+// _read will be called when the stream wants to pull more data in
+// the advisory size argument is ignored in this case.
+stream._read = function(n) {
+ source.readStart();
+};
+```
+
+### readable.unshift(chunk)
+
+* `chunk` {Buffer | null | String} Chunk of data to unshift onto the read queue
+* return {Boolean} Whether or not more pushes should be performed
+
+This is the corollary of `readable.push(chunk)`. Rather than putting
+the data at the *end* of the read queue, it puts it at the *front* of
+the read queue.
+
+This is useful in certain use-cases where a stream is being consumed
+by a parser, which needs to "un-consume" some data that it has
+optimistically pulled out of the source.
+
+```javascript
+// A parser for a simple data protocol.
+// The "header" is a JSON object, followed by 2 \n characters, and
+// then a message body.
+//
+// Note: This can be done more simply as a Transform stream. See below.
+
+function SimpleProtocol(source, options) {
+ if (!(this instanceof SimpleProtocol))
+ return new SimpleProtocol(options);
+
+ Readable.call(this, options);
+ this._inBody = false;
+ this._sawFirstCr = false;
+
+ // source is a readable stream, such as a socket or file
+ this._source = source;
+
+ var self = this;
+ source.on('end', function() {
+ self.push(null);
+ });
+
+ // give it a kick whenever the source is readable
+ // read(0) will not consume any bytes
+ source.on('readable', function() {
+ self.read(0);
+ });
+
+ this._rawHeader = [];
+ this.header = null;
+}
+
+SimpleProtocol.prototype = Object.create(
+ Readable.prototype, { constructor: { value: SimpleProtocol }});
+
+SimpleProtocol.prototype._read = function(n) {
+ if (!this._inBody) {
+ var chunk = this._source.read();
+
+ // if the source doesn't have data, we don't have data yet.
+ if (chunk === null)
+ return this.push('');
+
+ // check if the chunk has a \n\n
+ var split = -1;
+ for (var i = 0; i < chunk.length; i++) {
+ if (chunk[i] === 10) { // '\n'
+ if (this._sawFirstCr) {
+ split = i;
+ break;
+ } else {
+ this._sawFirstCr = true;
+ }
+ } else {
+ this._sawFirstCr = false;
+ }
+ }
+
+ if (split === -1) {
+ // still waiting for the \n\n
+ // stash the chunk, and try again.
+ this._rawHeader.push(chunk);
+ this.push('');
+ } else {
+ this._inBody = true;
+ var h = chunk.slice(0, split);
+ this._rawHeader.push(h);
+ var header = Buffer.concat(this._rawHeader).toString();
+ try {
+ this.header = JSON.parse(header);
+ } catch (er) {
+ this.emit('error', new Error('invalid simple protocol data'));
+ return;
+ }
+ // now, because we got some extra data, unshift the rest
+ // back into the read queue so that our consumer will see it.
+ var b = chunk.slice(split);
+ this.unshift(b);
+
+ // and let them know that we are done parsing the header.
+ this.emit('header', this.header);
+ }
+ } else {
+ // from there on, just provide the data to our consumer.
+ // careful not to push(null), since that would indicate EOF.
+ var chunk = this._source.read();
+ if (chunk) this.push(chunk);
+ }
+};
+
+// Usage:
+var parser = new SimpleProtocol(source);
+// Now parser is a readable stream that will emit 'header'
+// with the parsed header data.
+```
+
+### readable.wrap(stream)
+
+* `stream` {Stream} An "old style" readable stream
+
+If you are using an older Node library that emits `'data'` events and
+has a `pause()` method that is advisory only, then you can use the
+`wrap()` method to create a Readable stream that uses the old stream
+as its data source.
+
+For example:
+
+```javascript
+var OldReader = require('./old-api-module.js').OldReader;
+var oreader = new OldReader;
+var Readable = require('stream').Readable;
+var myReader = new Readable().wrap(oreader);
+
+myReader.on('readable', function() {
+ myReader.read(); // etc.
+});
+```
+
+### Event: 'readable'
+
+When there is data ready to be consumed, this event will fire.
+
+When this event emits, call the `read()` method to consume the data.
+
+### Event: 'end'
+
+Emitted when the stream has received an EOF (FIN in TCP terminology).
+Indicates that no more `'data'` events will happen. If the stream is
+also writable, it may be possible to continue writing.
+
+### Event: 'data'
+
+The `'data'` event emits either a `Buffer` (by default) or a string if
+`setEncoding()` was used.
+
+Note that adding a `'data'` event listener will switch the Readable
+stream into "old mode", where data is emitted as soon as it is
+available, rather than waiting for you to call `read()` to consume it.
+
+### Event: 'error'
+
+Emitted if there was an error receiving data.
+
+### Event: 'close'
+
+Emitted when the underlying resource (for example, the backing file
+descriptor) has been closed. Not all streams will emit this.
+
+### readable.setEncoding(encoding)
+
+Makes the `'data'` event emit a string instead of a `Buffer`. `encoding`
+can be `'utf8'`, `'utf16le'` (`'ucs2'`), `'ascii'`, or `'hex'`.
+
+The encoding can also be set by specifying an `encoding` field to the
+constructor.
+
+### readable.read([size])
+
+* `size` {Number | null} Optional number of bytes to read.
+* Return: {Buffer | String | null}
+
+Note: **This function SHOULD be called by Readable stream users.**
+
+Call this method to consume data once the `'readable'` event is
+emitted.
+
+The `size` argument will set a minimum number of bytes that you are
+interested in. If not set, then the entire content of the internal
+buffer is returned.
+
+If there is no data to consume, or if there are fewer bytes in the
+internal buffer than the `size` argument, then `null` is returned, and
+a future `'readable'` event will be emitted when more is available.
+
+Calling `stream.read(0)` will always return `null`, and will trigger a
+refresh of the internal buffer, but otherwise be a no-op.
+
+### readable.pipe(destination, [options])
+
+* `destination` {Writable Stream}
+* `options` {Object} Optional
+ * `end` {Boolean} Default=true
+
+Connects this readable stream to `destination` WriteStream. Incoming
+data on this stream gets written to `destination`. Properly manages
+back-pressure so that a slow destination will not be overwhelmed by a
+fast readable stream.
+
+This function returns the `destination` stream.
+
+For example, emulating the Unix `cat` command:
+
+ process.stdin.pipe(process.stdout);
+
+By default `end()` is called on the destination when the source stream
+emits `end`, so that `destination` is no longer writable. Pass `{ end:
+false }` as `options` to keep the destination stream open.
+
+This keeps `writer` open so that "Goodbye" can be written at the
+end.
+
+ reader.pipe(writer, { end: false });
+ reader.on("end", function() {
+ writer.end("Goodbye\n");
+ });
+
+Note that `process.stderr` and `process.stdout` are never closed until
+the process exits, regardless of the specified options.
+
+### readable.unpipe([destination])
+
+* `destination` {Writable Stream} Optional
+
+Undo a previously established `pipe()`. If no destination is
+provided, then all previously established pipes are removed.
+
+### readable.pause()
+
+Switches the readable stream into "old mode", where data is emitted
+using a `'data'` event rather than being buffered for consumption via
+the `read()` method.
+
+Ceases the flow of data. No `'data'` events are emitted while the
+stream is in a paused state.
+
+### readable.resume()
+
+Switches the readable stream into "old mode", where data is emitted
+using a `'data'` event rather than being buffered for consumption via
+the `read()` method.
+
+Resumes the incoming `'data'` events after a `pause()`.
+
+
+## Class: stream.Writable
+
+<!--type=class-->
+
+A `Writable` Stream has the following methods, members, and events.
+
+Note that `stream.Writable` is an abstract class designed to be
+extended with an underlying implementation of the
+`_write(chunk, encoding, cb)` method. (See below.)
+
+### new stream.Writable([options])
+
+* `options` {Object}
+ * `highWaterMark` {Number} Buffer level when `write()` starts
+ returning false. Default=16kb
+ * `decodeStrings` {Boolean} Whether or not to decode strings into
+ Buffers before passing them to `_write()`. Default=true
+
+In classes that extend the Writable class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+### writable.\_write(chunk, encoding, callback)
+
+* `chunk` {Buffer | String} The chunk to be written. Will always
+ be a buffer unless the `decodeStrings` option was set to `false`.
+* `encoding` {String} If the chunk is a string, then this is the
+ encoding type. Ignore chunk is a buffer. Note that chunk will
+ **always** be a buffer unless the `decodeStrings` option is
+ explicitly set to `false`.
+* `callback` {Function} Call this function (optionally with an error
+ argument) when you are done processing the supplied chunk.
+
+All Writable stream implementations must provide a `_write` method to
+send data to the underlying resource.
+
+Note: **This function MUST NOT be called directly.** It should be
+implemented by child classes, and called by the internal Writable
+class methods only.
+
+Call the callback using the standard `callback(error)` pattern to
+signal that the write completed successfully or with an error.
+
+If the `decodeStrings` flag is set in the constructor options, then
+`chunk` may be a string rather than a Buffer, and `encoding` will
+indicate the sort of string that it is. This is to support
+implementations that have an optimized handling for certain string
+data encodings. If you do not explicitly set the `decodeStrings`
+option to `false`, then you can safely ignore the `encoding` argument,
+and assume that `chunk` will always be a Buffer.
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs. However, you **are** expected to override this method in
+your own extension classes.
+
+
+### writable.write(chunk, [encoding], [callback])
+
+* `chunk` {Buffer | String} Data to be written
+* `encoding` {String} Optional. If `chunk` is a string, then encoding
+ defaults to `'utf8'`
+* `callback` {Function} Optional. Called when this chunk is
+ successfully written.
+* Returns {Boolean}
+
+Writes `chunk` to the stream. Returns `true` if the data has been
+flushed to the underlying resource. Returns `false` to indicate that
+the buffer is full, and the data will be sent out in the future. The
+`'drain'` event will indicate when the buffer is empty again.
+
+The specifics of when `write()` will return false, is determined by
+the `highWaterMark` option provided to the constructor.
+
+### writable.end([chunk], [encoding], [callback])
+
+* `chunk` {Buffer | String} Optional final data to be written
+* `encoding` {String} Optional. If `chunk` is a string, then encoding
+ defaults to `'utf8'`
+* `callback` {Function} Optional. Called when the final chunk is
+ successfully written.
+
+Call this method to signal the end of the data being written to the
+stream.
+
+### Event: 'drain'
+
+Emitted when the stream's write queue empties and it's safe to write
+without buffering again. Listen for it when `stream.write()` returns
+`false`.
+
+### Event: 'close'
+
+Emitted when the underlying resource (for example, the backing file
+descriptor) has been closed. Not all streams will emit this.
+
+### Event: 'finish'
+
+When `end()` is called and there are no more chunks to write, this
+event is emitted.
+
+### Event: 'pipe'
+
+* `source` {Readable Stream}
+
+Emitted when the stream is passed to a readable stream's pipe method.
+
+### Event 'unpipe'
+
+* `source` {Readable Stream}
+
+Emitted when a previously established `pipe()` is removed using the
+source Readable stream's `unpipe()` method.
+
+## Class: stream.Duplex
+
+<!--type=class-->
+
+A "duplex" stream is one that is both Readable and Writable, such as a
+TCP socket connection.
+
+Note that `stream.Duplex` is an abstract class designed to be
+extended with an underlying implementation of the `_read(size)`
+and `_write(chunk, encoding, callback)` methods as you would with a Readable or
+Writable stream class.
+
+Since JavaScript doesn't have multiple prototypal inheritance, this
+class prototypally inherits from Readable, and then parasitically from
+Writable. It is thus up to the user to implement both the lowlevel
+`_read(n)` method as well as the lowlevel `_write(chunk, encoding, cb)` method
+on extension duplex classes.
+
+### new stream.Duplex(options)
+
+* `options` {Object} Passed to both Writable and Readable
+ constructors. Also has the following fields:
+ * `allowHalfOpen` {Boolean} Default=true. If set to `false`, then
+ the stream will automatically end the readable side when the
+ writable side ends and vice versa.
+
+In classes that extend the Duplex class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+## Class: stream.Transform
+
+A "transform" stream is a duplex stream where the output is causally
+connected in some way to the input, such as a zlib stream or a crypto
+stream.
+
+There is no requirement that the output be the same size as the input,
+the same number of chunks, or arrive at the same time. For example, a
+Hash stream will only ever have a single chunk of output which is
+provided when the input is ended. A zlib stream will either produce
+much smaller or much larger than its input.
+
+Rather than implement the `_read()` and `_write()` methods, Transform
+classes must implement the `_transform()` method, and may optionally
+also implement the `_flush()` method. (See below.)
+
+### new stream.Transform([options])
+
+* `options` {Object} Passed to both Writable and Readable
+ constructors.
+
+In classes that extend the Transform class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+### transform.\_transform(chunk, encoding, callback)
+
+* `chunk` {Buffer | String} The chunk to be transformed. Will always
+ be a buffer unless the `decodeStrings` option was set to `false`.
+* `encoding` {String} If the chunk is a string, then this is the
+ encoding type. (Ignore if `decodeStrings` chunk is a buffer.)
+* `callback` {Function} Call this function (optionally with an error
+ argument) when you are done processing the supplied chunk.
+
+Note: **This function MUST NOT be called directly.** It should be
+implemented by child classes, and called by the internal Transform
+class methods only.
+
+All Transform stream implementations must provide a `_transform`
+method to accept input and produce output.
+
+`_transform` should do whatever has to be done in this specific
+Transform class, to handle the bytes being written, and pass them off
+to the readable portion of the interface. Do asynchronous I/O,
+process things, and so on.
+
+Call `transform.push(outputChunk)` 0 or more times to generate output
+from this input chunk, depending on how much data you want to output
+as a result of this chunk.
+
+Call the callback function only when the current chunk is completely
+consumed. Note that there may or may not be output as a result of any
+particular input chunk.
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs. However, you **are** expected to override this method in
+your own extension classes.
+
+### transform.\_flush(callback)
+
+* `callback` {Function} Call this function (optionally with an error
+ argument) when you are done flushing any remaining data.
+
+Note: **This function MUST NOT be called directly.** It MAY be implemented
+by child classes, and if so, will be called by the internal Transform
+class methods only.
+
+In some cases, your transform operation may need to emit a bit more
+data at the end of the stream. For example, a `Zlib` compression
+stream will store up some internal state so that it can optimally
+compress the output. At the end, however, it needs to do the best it
+can with what is left, so that the data will be complete.
+
+In those cases, you can implement a `_flush` method, which will be
+called at the very end, after all the written data is consumed, but
+before emitting `end` to signal the end of the readable side. Just
+like with `_transform`, call `transform.push(chunk)` zero or more
+times, as appropriate, and call `callback` when the flush operation is
+complete.
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs. However, you **are** expected to override this method in
+your own extension classes.
+
+### Example: `SimpleProtocol` parser
+
+The example above of a simple protocol parser can be implemented much
+more simply by using the higher level `Transform` stream class.
+
+In this example, rather than providing the input as an argument, it
+would be piped into the parser, which is a more idiomatic Node stream
+approach.
+
+```javascript
+function SimpleProtocol(options) {
+ if (!(this instanceof SimpleProtocol))
+ return new SimpleProtocol(options);
+
+ Transform.call(this, options);
+ this._inBody = false;
+ this._sawFirstCr = false;
+ this._rawHeader = [];
+ this.header = null;
+}
+
+SimpleProtocol.prototype = Object.create(
+ Transform.prototype, { constructor: { value: SimpleProtocol }});
+
+SimpleProtocol.prototype._transform = function(chunk, encoding, done) {
+ if (!this._inBody) {
+ // check if the chunk has a \n\n
+ var split = -1;
+ for (var i = 0; i < chunk.length; i++) {
+ if (chunk[i] === 10) { // '\n'
+ if (this._sawFirstCr) {
+ split = i;
+ break;
+ } else {
+ this._sawFirstCr = true;
+ }
+ } else {
+ this._sawFirstCr = false;
+ }
+ }
+
+ if (split === -1) {
+ // still waiting for the \n\n
+ // stash the chunk, and try again.
+ this._rawHeader.push(chunk);
+ } else {
+ this._inBody = true;
+ var h = chunk.slice(0, split);
+ this._rawHeader.push(h);
+ var header = Buffer.concat(this._rawHeader).toString();
+ try {
+ this.header = JSON.parse(header);
+ } catch (er) {
+ this.emit('error', new Error('invalid simple protocol data'));
+ return;
+ }
+ // and let them know that we are done parsing the header.
+ this.emit('header', this.header);
+
+ // now, because we got some extra data, emit this first.
+ this.push(b);
+ }
+ } else {
+ // from there on, just provide the data to our consumer as-is.
+ this.push(b);
+ }
+ done();
+};
+
+var parser = new SimpleProtocol();
+source.pipe(parser)
+
+// Now parser is a readable stream that will emit 'header'
+// with the parsed header data.
+```
+
+
+## Class: stream.PassThrough
+
+This is a trivial implementation of a `Transform` stream that simply
+passes the input bytes across to the output. Its purpose is mainly
+for examples and testing, but there are occasionally use cases where
+it can come in handy.
+
+
+[EventEmitter]: events.html#events_class_events_eventemitter
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/sha/node_modules/readable-stream/duplex.js
new file mode 100644
index 000000000..ca807af87
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/duplex.js
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_duplex.js")
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS b/deps/npm/node_modules/sha/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS
new file mode 100644
index 000000000..205a42564
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS
@@ -0,0 +1,32 @@
+var Transform = require('../transform');
+var inherits = require('util').inherits;
+
+// subclass
+function MyStream () {
+ Transform.call(this, {
+ lowWaterMark: 0,
+ encoding: 'utf8'
+ });
+}
+inherits(MyStream, Transform);
+
+MyStream.prototype._transform = function (chunk, outputFn, callback) {
+ outputFn(new Buffer(String(chunk).toUpperCase()));
+ callback();
+};
+
+// use it!
+var s = new MyStream();
+process.stdin.resume();
+process.stdin.pipe(s).pipe(process.stdout);
+if (process.stdin.setRawMode)
+ process.stdin.setRawMode(true);
+process.stdin.on('data', function (c) {
+ c = c.toString();
+ if (c === '\u0003' || c === '\u0004') {
+ process.stdin.pause();
+ s.end();
+ }
+ if (c === '\r')
+ process.stdout.write('\n');
+});
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/examples/typer-fsr.js b/deps/npm/node_modules/sha/node_modules/readable-stream/examples/typer-fsr.js
new file mode 100644
index 000000000..7e715844b
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/examples/typer-fsr.js
@@ -0,0 +1,15 @@
+var fs = require('fs');
+var FSReadable = require('../fs.js');
+var rst = new FSReadable(__filename);
+
+rst.on('end', function() {
+ process.stdin.pause();
+});
+
+process.stdin.setRawMode(true);
+process.stdin.on('data', function() {
+ var c = rst.read(3);
+ if (!c) return;
+ process.stdout.write(c);
+});
+process.stdin.resume();
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/examples/typer.js b/deps/npm/node_modules/sha/node_modules/readable-stream/examples/typer.js
new file mode 100644
index 000000000..c16eb6fb0
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/examples/typer.js
@@ -0,0 +1,17 @@
+var fs = require('fs');
+var fst = fs.createReadStream(__filename);
+var Readable = require('../readable.js');
+var rst = new Readable();
+rst.wrap(fst);
+
+rst.on('end', function() {
+ process.stdin.pause();
+});
+
+process.stdin.setRawMode(true);
+process.stdin.on('data', function() {
+ var c = rst.read(3);
+ if (!c) return setTimeout(process.exit, 500)
+ process.stdout.write(c);
+});
+process.stdin.resume();
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/fs.js b/deps/npm/node_modules/sha/node_modules/readable-stream/fs.js
new file mode 100644
index 000000000..a663af86e
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/fs.js
@@ -0,0 +1,1705 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+// Maintainers, keep in mind that octal literals are not allowed
+// in strict mode. Use the decimal value and add a comment with
+// the octal value. Example:
+//
+// var mode = 438; /* mode=0666 */
+
+var util = require('util');
+var pathModule = require('path');
+
+var binding = process.binding('fs');
+var constants = process.binding('constants');
+var fs = exports;
+var Stream = require('stream').Stream;
+var EventEmitter = require('events').EventEmitter;
+
+var Readable = require('./lib/_stream_readable.js');
+var Writable = require('./lib/_stream_writable.js');
+
+var kMinPoolSpace = 128;
+var kPoolSize = 40 * 1024;
+
+var O_APPEND = constants.O_APPEND || 0;
+var O_CREAT = constants.O_CREAT || 0;
+var O_DIRECTORY = constants.O_DIRECTORY || 0;
+var O_EXCL = constants.O_EXCL || 0;
+var O_NOCTTY = constants.O_NOCTTY || 0;
+var O_NOFOLLOW = constants.O_NOFOLLOW || 0;
+var O_RDONLY = constants.O_RDONLY || 0;
+var O_RDWR = constants.O_RDWR || 0;
+var O_SYMLINK = constants.O_SYMLINK || 0;
+var O_SYNC = constants.O_SYNC || 0;
+var O_TRUNC = constants.O_TRUNC || 0;
+var O_WRONLY = constants.O_WRONLY || 0;
+
+var isWindows = process.platform === 'win32';
+
+var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
+
+function rethrow() {
+ // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and
+ // is fairly slow to generate.
+ if (DEBUG) {
+ var backtrace = new Error;
+ return function(err) {
+ if (err) {
+ backtrace.message = err.message;
+ err = backtrace;
+ throw err;
+ }
+ };
+ }
+
+ return function(err) {
+ if (err) {
+ throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs
+ }
+ };
+}
+
+function maybeCallback(cb) {
+ return typeof cb === 'function' ? cb : rethrow();
+}
+
+// Ensure that callbacks run in the global context. Only use this function
+// for callbacks that are passed to the binding layer, callbacks that are
+// invoked from JS already run in the proper scope.
+function makeCallback(cb) {
+ if (typeof cb !== 'function') {
+ return rethrow();
+ }
+
+ return function() {
+ return cb.apply(null, arguments);
+ };
+}
+
+function assertEncoding(encoding) {
+ if (encoding && !Buffer.isEncoding(encoding)) {
+ throw new Error('Unknown encoding: ' + encoding);
+ }
+}
+
+function nullCheck(path, callback) {
+ if (('' + path).indexOf('\u0000') !== -1) {
+ var er = new Error('Path must be a string without null bytes.');
+ if (!callback)
+ throw er;
+ process.nextTick(function() {
+ callback(er);
+ });
+ return false;
+ }
+ return true;
+}
+
+fs.Stats = binding.Stats;
+
+fs.Stats.prototype._checkModeProperty = function(property) {
+ return ((this.mode & constants.S_IFMT) === property);
+};
+
+fs.Stats.prototype.isDirectory = function() {
+ return this._checkModeProperty(constants.S_IFDIR);
+};
+
+fs.Stats.prototype.isFile = function() {
+ return this._checkModeProperty(constants.S_IFREG);
+};
+
+fs.Stats.prototype.isBlockDevice = function() {
+ return this._checkModeProperty(constants.S_IFBLK);
+};
+
+fs.Stats.prototype.isCharacterDevice = function() {
+ return this._checkModeProperty(constants.S_IFCHR);
+};
+
+fs.Stats.prototype.isSymbolicLink = function() {
+ return this._checkModeProperty(constants.S_IFLNK);
+};
+
+fs.Stats.prototype.isFIFO = function() {
+ return this._checkModeProperty(constants.S_IFIFO);
+};
+
+fs.Stats.prototype.isSocket = function() {
+ return this._checkModeProperty(constants.S_IFSOCK);
+};
+
+fs.exists = function(path, callback) {
+ if (!nullCheck(path, cb)) return;
+ binding.stat(pathModule._makeLong(path), cb);
+ function cb(err, stats) {
+ if (callback) callback(err ? false : true);
+ }
+};
+
+fs.existsSync = function(path) {
+ try {
+ nullCheck(path);
+ binding.stat(pathModule._makeLong(path));
+ return true;
+ } catch (e) {
+ return false;
+ }
+};
+
+fs.readFile = function(path, encoding_) {
+ var encoding = typeof(encoding_) === 'string' ? encoding_ : null;
+ var callback = maybeCallback(arguments[arguments.length - 1]);
+
+ assertEncoding(encoding);
+
+ // first, stat the file, so we know the size.
+ var size;
+ var buffer; // single buffer with file data
+ var buffers; // list for when size is unknown
+ var pos = 0;
+ var fd;
+
+ fs.open(path, constants.O_RDONLY, 438 /*=0666*/, function(er, fd_) {
+ if (er) return callback(er);
+ fd = fd_;
+
+ fs.fstat(fd, function(er, st) {
+ if (er) return callback(er);
+ size = st.size;
+ if (size === 0) {
+ // the kernel lies about many files.
+ // Go ahead and try to read some bytes.
+ buffers = [];
+ return read();
+ }
+
+ buffer = new Buffer(size);
+ read();
+ });
+ });
+
+ function read() {
+ if (size === 0) {
+ buffer = new Buffer(8192);
+ fs.read(fd, buffer, 0, 8192, -1, afterRead);
+ } else {
+ fs.read(fd, buffer, pos, size - pos, -1, afterRead);
+ }
+ }
+
+ function afterRead(er, bytesRead) {
+ if (er) {
+ return fs.close(fd, function(er2) {
+ return callback(er);
+ });
+ }
+
+ if (bytesRead === 0) {
+ return close();
+ }
+
+ pos += bytesRead;
+ if (size !== 0) {
+ if (pos === size) close();
+ else read();
+ } else {
+ // unknown size, just read until we don't get bytes.
+ buffers.push(buffer.slice(0, bytesRead));
+ read();
+ }
+ }
+
+ function close() {
+ fs.close(fd, function(er) {
+ if (size === 0) {
+ // collected the data into the buffers list.
+ buffer = Buffer.concat(buffers, pos);
+ } else if (pos < size) {
+ buffer = buffer.slice(0, pos);
+ }
+
+ if (encoding) buffer = buffer.toString(encoding);
+ return callback(er, buffer);
+ });
+ }
+};
+
+fs.readFileSync = function(path, encoding) {
+ assertEncoding(encoding);
+
+ var fd = fs.openSync(path, constants.O_RDONLY, 438 /*=0666*/);
+
+ var size;
+ var threw = true;
+ try {
+ size = fs.fstatSync(fd).size;
+ threw = false;
+ } finally {
+ if (threw) fs.closeSync(fd);
+ }
+
+ var pos = 0;
+ var buffer; // single buffer with file data
+ var buffers; // list for when size is unknown
+
+ if (size === 0) {
+ buffers = [];
+ } else {
+ buffer = new Buffer(size);
+ }
+
+ var done = false;
+ while (!done) {
+ var threw = true;
+ try {
+ if (size !== 0) {
+ var bytesRead = fs.readSync(fd, buffer, pos, size - pos);
+ } else {
+ // the kernel lies about many files.
+ // Go ahead and try to read some bytes.
+ buffer = new Buffer(8192);
+ var bytesRead = fs.readSync(fd, buffer, 0, 8192);
+ if (bytesRead) {
+ buffers.push(buffer.slice(0, bytesRead));
+ }
+ }
+ threw = false;
+ } finally {
+ if (threw) fs.closeSync(fd);
+ }
+
+ pos += bytesRead;
+ done = (bytesRead === 0) || (size !== 0 && pos >= size);
+ }
+
+ fs.closeSync(fd);
+
+ if (size === 0) {
+ // data was collected into the buffers list.
+ buffer = Buffer.concat(buffers, pos);
+ } else if (pos < size) {
+ buffer = buffer.slice(0, pos);
+ }
+
+ if (encoding) buffer = buffer.toString(encoding);
+ return buffer;
+};
+
+
+// Used by binding.open and friends
+function stringToFlags(flag) {
+ // Only mess with strings
+ if (typeof flag !== 'string') {
+ return flag;
+ }
+
+ // O_EXCL is mandated by POSIX, Windows supports it too.
+ // Let's add a check anyway, just in case.
+ if (!O_EXCL && ~flag.indexOf('x')) {
+ throw errnoException('ENOSYS', 'fs.open(O_EXCL)');
+ }
+
+ switch (flag) {
+ case 'r' : return O_RDONLY;
+ case 'rs' : return O_RDONLY | O_SYNC;
+ case 'r+' : return O_RDWR;
+ case 'rs+' : return O_RDWR | O_SYNC;
+
+ case 'w' : return O_TRUNC | O_CREAT | O_WRONLY;
+ case 'wx' : // fall through
+ case 'xw' : return O_TRUNC | O_CREAT | O_WRONLY | O_EXCL;
+
+ case 'w+' : return O_TRUNC | O_CREAT | O_RDWR;
+ case 'wx+': // fall through
+ case 'xw+': return O_TRUNC | O_CREAT | O_RDWR | O_EXCL;
+
+ case 'a' : return O_APPEND | O_CREAT | O_WRONLY;
+ case 'ax' : // fall through
+ case 'xa' : return O_APPEND | O_CREAT | O_WRONLY | O_EXCL;
+
+ case 'a+' : return O_APPEND | O_CREAT | O_RDWR;
+ case 'ax+': // fall through
+ case 'xa+': return O_APPEND | O_CREAT | O_RDWR | O_EXCL;
+ }
+
+ throw new Error('Unknown file open flag: ' + flag);
+}
+
+// exported but hidden, only used by test/simple/test-fs-open-flags.js
+Object.defineProperty(exports, '_stringToFlags', {
+ enumerable: false,
+ value: stringToFlags
+});
+
+
+// Yes, the follow could be easily DRYed up but I provide the explicit
+// list to make the arguments clear.
+
+fs.close = function(fd, callback) {
+ binding.close(fd, makeCallback(callback));
+};
+
+fs.closeSync = function(fd) {
+ return binding.close(fd);
+};
+
+function modeNum(m, def) {
+ switch (typeof m) {
+ case 'number': return m;
+ case 'string': return parseInt(m, 8);
+ default:
+ if (def) {
+ return modeNum(def);
+ } else {
+ return undefined;
+ }
+ }
+}
+
+fs.open = function(path, flags, mode, callback) {
+ callback = makeCallback(arguments[arguments.length - 1]);
+ mode = modeNum(mode, 438 /*=0666*/);
+
+ if (!nullCheck(path, callback)) return;
+ binding.open(pathModule._makeLong(path),
+ stringToFlags(flags),
+ mode,
+ callback);
+};
+
+fs.openSync = function(path, flags, mode) {
+ mode = modeNum(mode, 438 /*=0666*/);
+ nullCheck(path);
+ return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
+};
+
+fs.read = function(fd, buffer, offset, length, position, callback) {
+ if (!Buffer.isBuffer(buffer)) {
+ // legacy string interface (fd, length, position, encoding, callback)
+ var cb = arguments[4],
+ encoding = arguments[3];
+
+ assertEncoding(encoding);
+
+ position = arguments[2];
+ length = arguments[1];
+ buffer = new Buffer(length);
+ offset = 0;
+
+ callback = function(err, bytesRead) {
+ if (!cb) return;
+
+ var str = (bytesRead > 0) ? buffer.toString(encoding, 0, bytesRead) : '';
+
+ (cb)(err, str, bytesRead);
+ };
+ }
+
+ function wrapper(err, bytesRead) {
+ // Retain a reference to buffer so that it can't be GC'ed too soon.
+ callback && callback(err, bytesRead || 0, buffer);
+ }
+
+ binding.read(fd, buffer, offset, length, position, wrapper);
+};
+
+fs.readSync = function(fd, buffer, offset, length, position) {
+ var legacy = false;
+ if (!Buffer.isBuffer(buffer)) {
+ // legacy string interface (fd, length, position, encoding, callback)
+ legacy = true;
+ var encoding = arguments[3];
+
+ assertEncoding(encoding);
+
+ position = arguments[2];
+ length = arguments[1];
+ buffer = new Buffer(length);
+
+ offset = 0;
+ }
+
+ var r = binding.read(fd, buffer, offset, length, position);
+ if (!legacy) {
+ return r;
+ }
+
+ var str = (r > 0) ? buffer.toString(encoding, 0, r) : '';
+ return [str, r];
+};
+
+fs.write = function(fd, buffer, offset, length, position, callback) {
+ if (!Buffer.isBuffer(buffer)) {
+ // legacy string interface (fd, data, position, encoding, callback)
+ callback = arguments[4];
+ position = arguments[2];
+ assertEncoding(arguments[3]);
+
+ buffer = new Buffer('' + arguments[1], arguments[3]);
+ offset = 0;
+ length = buffer.length;
+ }
+
+ if (!length) {
+ if (typeof callback == 'function') {
+ process.nextTick(function() {
+ callback(undefined, 0);
+ });
+ }
+ return;
+ }
+
+ callback = maybeCallback(callback);
+
+ function wrapper(err, written) {
+ // Retain a reference to buffer so that it can't be GC'ed too soon.
+ callback(err, written || 0, buffer);
+ }
+
+ binding.write(fd, buffer, offset, length, position, wrapper);
+};
+
+fs.writeSync = function(fd, buffer, offset, length, position) {
+ if (!Buffer.isBuffer(buffer)) {
+ // legacy string interface (fd, data, position, encoding)
+ position = arguments[2];
+ assertEncoding(arguments[3]);
+
+ buffer = new Buffer('' + arguments[1], arguments[3]);
+ offset = 0;
+ length = buffer.length;
+ }
+ if (!length) return 0;
+
+ return binding.write(fd, buffer, offset, length, position);
+};
+
+fs.rename = function(oldPath, newPath, callback) {
+ callback = makeCallback(callback);
+ if (!nullCheck(oldPath, callback)) return;
+ if (!nullCheck(newPath, callback)) return;
+ binding.rename(pathModule._makeLong(oldPath),
+ pathModule._makeLong(newPath),
+ callback);
+};
+
+fs.renameSync = function(oldPath, newPath) {
+ nullCheck(oldPath);
+ nullCheck(newPath);
+ return binding.rename(pathModule._makeLong(oldPath),
+ pathModule._makeLong(newPath));
+};
+
+fs.truncate = function(path, len, callback) {
+ if (typeof path === 'number') {
+ // legacy
+ return fs.ftruncate(path, len, callback);
+ }
+ if (typeof len === 'function') {
+ callback = len;
+ len = 0;
+ } else if (typeof len === 'undefined') {
+ len = 0;
+ }
+ callback = maybeCallback(callback);
+ fs.open(path, 'w', function(er, fd) {
+ if (er) return callback(er);
+ binding.ftruncate(fd, len, function(er) {
+ fs.close(fd, function(er2) {
+ callback(er || er2);
+ });
+ });
+ });
+};
+
+fs.truncateSync = function(path, len) {
+ if (typeof path === 'number') {
+ // legacy
+ return fs.ftruncateSync(path, len);
+ }
+ if (typeof len === 'undefined') {
+ len = 0;
+ }
+ // allow error to be thrown, but still close fd.
+ var fd = fs.openSync(path, 'w');
+ try {
+ var ret = fs.ftruncateSync(fd, len);
+ } finally {
+ fs.closeSync(fd);
+ }
+ return ret;
+};
+
+fs.ftruncate = function(fd, len, callback) {
+ if (typeof len === 'function') {
+ callback = len;
+ len = 0;
+ } else if (typeof len === 'undefined') {
+ len = 0;
+ }
+ binding.ftruncate(fd, len, makeCallback(callback));
+};
+
+fs.ftruncateSync = function(fd, len) {
+ if (typeof len === 'undefined') {
+ len = 0;
+ }
+ return binding.ftruncate(fd, len);
+};
+
+fs.rmdir = function(path, callback) {
+ callback = makeCallback(callback);
+ if (!nullCheck(path, callback)) return;
+ binding.rmdir(pathModule._makeLong(path), callback);
+};
+
+fs.rmdirSync = function(path) {
+ nullCheck(path);
+ return binding.rmdir(pathModule._makeLong(path));
+};
+
+fs.fdatasync = function(fd, callback) {
+ binding.fdatasync(fd, makeCallback(callback));
+};
+
+fs.fdatasyncSync = function(fd) {
+ return binding.fdatasync(fd);
+};
+
+fs.fsync = function(fd, callback) {
+ binding.fsync(fd, makeCallback(callback));
+};
+
+fs.fsyncSync = function(fd) {
+ return binding.fsync(fd);
+};
+
+fs.mkdir = function(path, mode, callback) {
+ if (typeof mode === 'function') callback = mode;
+ callback = makeCallback(callback);
+ if (!nullCheck(path, callback)) return;
+ binding.mkdir(pathModule._makeLong(path),
+ modeNum(mode, 511 /*=0777*/),
+ callback);
+};
+
+fs.mkdirSync = function(path, mode) {
+ nullCheck(path);
+ return binding.mkdir(pathModule._makeLong(path),
+ modeNum(mode, 511 /*=0777*/));
+};
+
+fs.sendfile = function(outFd, inFd, inOffset, length, callback) {
+ binding.sendfile(outFd, inFd, inOffset, length, makeCallback(callback));
+};
+
+fs.sendfileSync = function(outFd, inFd, inOffset, length) {
+ return binding.sendfile(outFd, inFd, inOffset, length);
+};
+
+fs.readdir = function(path, callback) {
+ callback = makeCallback(callback);
+ if (!nullCheck(path, callback)) return;
+ binding.readdir(pathModule._makeLong(path), callback);
+};
+
+fs.readdirSync = function(path) {
+ nullCheck(path);
+ return binding.readdir(pathModule._makeLong(path));
+};
+
+fs.fstat = function(fd, callback) {
+ binding.fstat(fd, makeCallback(callback));
+};
+
+fs.lstat = function(path, callback) {
+ callback = makeCallback(callback);
+ if (!nullCheck(path, callback)) return;
+ binding.lstat(pathModule._makeLong(path), callback);
+};
+
+fs.stat = function(path, callback) {
+ callback = makeCallback(callback);
+ if (!nullCheck(path, callback)) return;
+ binding.stat(pathModule._makeLong(path), callback);
+};
+
+fs.fstatSync = function(fd) {
+ return binding.fstat(fd);
+};
+
+fs.lstatSync = function(path) {
+ nullCheck(path);
+ return binding.lstat(pathModule._makeLong(path));
+};
+
+fs.statSync = function(path) {
+ nullCheck(path);
+ return binding.stat(pathModule._makeLong(path));
+};
+
+fs.readlink = function(path, callback) {
+ callback = makeCallback(callback);
+ if (!nullCheck(path, callback)) return;
+ binding.readlink(pathModule._makeLong(path), callback);
+};
+
+fs.readlinkSync = function(path) {
+ nullCheck(path);
+ return binding.readlink(pathModule._makeLong(path));
+};
+
+function preprocessSymlinkDestination(path, type) {
+ if (!isWindows) {
+ // No preprocessing is needed on Unix.
+ return path;
+ } else if (type === 'junction') {
+ // Junctions paths need to be absolute and \\?\-prefixed.
+ return pathModule._makeLong(path);
+ } else {
+ // Windows symlinks don't tolerate forward slashes.
+ return ('' + path).replace(/\//g, '\\');
+ }
+}
+
+fs.symlink = function(destination, path, type_, callback) {
+ var type = (typeof type_ === 'string' ? type_ : null);
+ var callback = makeCallback(arguments[arguments.length - 1]);
+
+ if (!nullCheck(destination, callback)) return;
+ if (!nullCheck(path, callback)) return;
+
+ binding.symlink(preprocessSymlinkDestination(destination, type),
+ pathModule._makeLong(path),
+ type,
+ callback);
+};
+
+fs.symlinkSync = function(destination, path, type) {
+ type = (typeof type === 'string' ? type : null);
+
+ nullCheck(destination);
+ nullCheck(path);
+
+ return binding.symlink(preprocessSymlinkDestination(destination, type),
+ pathModule._makeLong(path),
+ type);
+};
+
+fs.link = function(srcpath, dstpath, callback) {
+ callback = makeCallback(callback);
+ if (!nullCheck(srcpath, callback)) return;
+ if (!nullCheck(dstpath, callback)) return;
+
+ binding.link(pathModule._makeLong(srcpath),
+ pathModule._makeLong(dstpath),
+ callback);
+};
+
+fs.linkSync = function(srcpath, dstpath) {
+ nullCheck(srcpath);
+ nullCheck(dstpath);
+ return binding.link(pathModule._makeLong(srcpath),
+ pathModule._makeLong(dstpath));
+};
+
+fs.unlink = function(path, callback) {
+ callback = makeCallback(callback);
+ if (!nullCheck(path, callback)) return;
+ binding.unlink(pathModule._makeLong(path), callback);
+};
+
+fs.unlinkSync = function(path) {
+ nullCheck(path);
+ return binding.unlink(pathModule._makeLong(path));
+};
+
+fs.fchmod = function(fd, mode, callback) {
+ binding.fchmod(fd, modeNum(mode), makeCallback(callback));
+};
+
+fs.fchmodSync = function(fd, mode) {
+ return binding.fchmod(fd, modeNum(mode));
+};
+
+if (constants.hasOwnProperty('O_SYMLINK')) {
+ fs.lchmod = function(path, mode, callback) {
+ callback = maybeCallback(callback);
+ fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, function(err, fd) {
+ if (err) {
+ callback(err);
+ return;
+ }
+ // prefer to return the chmod error, if one occurs,
+ // but still try to close, and report closing errors if they occur.
+ fs.fchmod(fd, mode, function(err) {
+ fs.close(fd, function(err2) {
+ callback(err || err2);
+ });
+ });
+ });
+ };
+
+ fs.lchmodSync = function(path, mode) {
+ var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK);
+
+ // prefer to return the chmod error, if one occurs,
+ // but still try to close, and report closing errors if they occur.
+ var err, err2;
+ try {
+ var ret = fs.fchmodSync(fd, mode);
+ } catch (er) {
+ err = er;
+ }
+ try {
+ fs.closeSync(fd);
+ } catch (er) {
+ err2 = er;
+ }
+ if (err || err2) throw (err || err2);
+ return ret;
+ };
+}
+
+
+fs.chmod = function(path, mode, callback) {
+ callback = makeCallback(callback);
+ if (!nullCheck(path, callback)) return;
+ binding.chmod(pathModule._makeLong(path),
+ modeNum(mode),
+ callback);
+};
+
+fs.chmodSync = function(path, mode) {
+ nullCheck(path);
+ return binding.chmod(pathModule._makeLong(path), modeNum(mode));
+};
+
+if (constants.hasOwnProperty('O_SYMLINK')) {
+ fs.lchown = function(path, uid, gid, callback) {
+ callback = maybeCallback(callback);
+ fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, function(err, fd) {
+ if (err) {
+ callback(err);
+ return;
+ }
+ fs.fchown(fd, uid, gid, callback);
+ });
+ };
+
+ fs.lchownSync = function(path, uid, gid) {
+ var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK);
+ return fs.fchownSync(fd, uid, gid);
+ };
+}
+
+fs.fchown = function(fd, uid, gid, callback) {
+ binding.fchown(fd, uid, gid, makeCallback(callback));
+};
+
+fs.fchownSync = function(fd, uid, gid) {
+ return binding.fchown(fd, uid, gid);
+};
+
+fs.chown = function(path, uid, gid, callback) {
+ callback = makeCallback(callback);
+ if (!nullCheck(path, callback)) return;
+ binding.chown(pathModule._makeLong(path), uid, gid, callback);
+};
+
+fs.chownSync = function(path, uid, gid) {
+ nullCheck(path);
+ return binding.chown(pathModule._makeLong(path), uid, gid);
+};
+
+// converts Date or number to a fractional UNIX timestamp
+function toUnixTimestamp(time) {
+ if (typeof time == 'number') {
+ return time;
+ }
+ if (time instanceof Date) {
+ // convert to 123.456 UNIX timestamp
+ return time.getTime() / 1000;
+ }
+ throw new Error('Cannot parse time: ' + time);
+}
+
+// exported for unit tests, not for public consumption
+fs._toUnixTimestamp = toUnixTimestamp;
+
+fs.utimes = function(path, atime, mtime, callback) {
+ callback = makeCallback(callback);
+ if (!nullCheck(path, callback)) return;
+ binding.utimes(pathModule._makeLong(path),
+ toUnixTimestamp(atime),
+ toUnixTimestamp(mtime),
+ callback);
+};
+
+fs.utimesSync = function(path, atime, mtime) {
+ nullCheck(path);
+ atime = toUnixTimestamp(atime);
+ mtime = toUnixTimestamp(mtime);
+ binding.utimes(pathModule._makeLong(path), atime, mtime);
+};
+
+fs.futimes = function(fd, atime, mtime, callback) {
+ atime = toUnixTimestamp(atime);
+ mtime = toUnixTimestamp(mtime);
+ binding.futimes(fd, atime, mtime, makeCallback(callback));
+};
+
+fs.futimesSync = function(fd, atime, mtime) {
+ atime = toUnixTimestamp(atime);
+ mtime = toUnixTimestamp(mtime);
+ binding.futimes(fd, atime, mtime);
+};
+
+function writeAll(fd, buffer, offset, length, position, callback) {
+ callback = maybeCallback(arguments[arguments.length - 1]);
+
+ // write(fd, buffer, offset, length, position, callback)
+ fs.write(fd, buffer, offset, length, position, function(writeErr, written) {
+ if (writeErr) {
+ fs.close(fd, function() {
+ if (callback) callback(writeErr);
+ });
+ } else {
+ if (written === length) {
+ fs.close(fd, callback);
+ } else {
+ offset += written;
+ length -= written;
+ position += written;
+ writeAll(fd, buffer, offset, length, position, callback);
+ }
+ }
+ });
+}
+
+fs.writeFile = function(path, data, encoding_, callback) {
+ var encoding = (typeof(encoding_) == 'string' ? encoding_ : 'utf8');
+ assertEncoding(encoding);
+
+ callback = maybeCallback(arguments[arguments.length - 1]);
+ fs.open(path, 'w', 438 /*=0666*/, function(openErr, fd) {
+ if (openErr) {
+ if (callback) callback(openErr);
+ } else {
+ var buffer = Buffer.isBuffer(data) ? data : new Buffer('' + data,
+ encoding);
+ writeAll(fd, buffer, 0, buffer.length, 0, callback);
+ }
+ });
+};
+
+fs.writeFileSync = function(path, data, encoding) {
+ assertEncoding(encoding);
+
+ var fd = fs.openSync(path, 'w');
+ if (!Buffer.isBuffer(data)) {
+ data = new Buffer('' + data, encoding || 'utf8');
+ }
+ var written = 0;
+ var length = data.length;
+ try {
+ while (written < length) {
+ written += fs.writeSync(fd, data, written, length - written, written);
+ }
+ } finally {
+ fs.closeSync(fd);
+ }
+};
+
+fs.appendFile = function(path, data, encoding_, callback) {
+ var encoding = (typeof(encoding_) == 'string' ? encoding_ : 'utf8');
+ assertEncoding(encoding);
+
+ callback = maybeCallback(arguments[arguments.length - 1]);
+
+ fs.open(path, 'a', 438 /*=0666*/, function(err, fd) {
+ if (err) return callback(err);
+ var buffer = Buffer.isBuffer(data) ? data : new Buffer('' + data, encoding);
+ writeAll(fd, buffer, 0, buffer.length, null, callback);
+ });
+};
+
+fs.appendFileSync = function(path, data, encoding) {
+ assertEncoding(encoding);
+
+ var fd = fs.openSync(path, 'a');
+ if (!Buffer.isBuffer(data)) {
+ data = new Buffer('' + data, encoding || 'utf8');
+ }
+ var written = 0;
+ var position = null;
+ var length = data.length;
+
+ try {
+ while (written < length) {
+ written += fs.writeSync(fd, data, written, length - written, position);
+ position += written; // XXX not safe with multiple concurrent writers?
+ }
+ } finally {
+ fs.closeSync(fd);
+ }
+};
+
+function errnoException(errorno, syscall) {
+ // TODO make this more compatible with ErrnoException from src/node.cc
+ // Once all of Node is using this function the ErrnoException from
+ // src/node.cc should be removed.
+ var e = new Error(syscall + ' ' + errorno);
+ e.errno = e.code = errorno;
+ e.syscall = syscall;
+ return e;
+}
+
+
+function FSWatcher() {
+ EventEmitter.call(this);
+
+ var self = this;
+ var FSEvent = process.binding('fs_event_wrap').FSEvent;
+ this._handle = new FSEvent();
+ this._handle.owner = this;
+
+ this._handle.onchange = function(status, event, filename) {
+ if (status) {
+ self._handle.close();
+ self.emit('error', errnoException(errno, 'watch'));
+ } else {
+ self.emit('change', event, filename);
+ }
+ };
+}
+util.inherits(FSWatcher, EventEmitter);
+
+FSWatcher.prototype.start = function(filename, persistent) {
+ nullCheck(filename);
+ var r = this._handle.start(pathModule._makeLong(filename), persistent);
+
+ if (r) {
+ this._handle.close();
+ throw errnoException(errno, 'watch');
+ }
+};
+
+FSWatcher.prototype.close = function() {
+ this._handle.close();
+};
+
+fs.watch = function(filename) {
+ nullCheck(filename);
+ var watcher;
+ var options;
+ var listener;
+
+ if ('object' == typeof arguments[1]) {
+ options = arguments[1];
+ listener = arguments[2];
+ } else {
+ options = {};
+ listener = arguments[1];
+ }
+
+ if (options.persistent === undefined) options.persistent = true;
+
+ watcher = new FSWatcher();
+ watcher.start(filename, options.persistent);
+
+ if (listener) {
+ watcher.addListener('change', listener);
+ }
+
+ return watcher;
+};
+
+
+// Stat Change Watchers
+
+function StatWatcher() {
+ EventEmitter.call(this);
+
+ var self = this;
+ this._handle = new binding.StatWatcher();
+
+ // uv_fs_poll is a little more powerful than ev_stat but we curb it for
+ // the sake of backwards compatibility
+ var oldStatus = -1;
+
+ this._handle.onchange = function(current, previous, newStatus) {
+ if (oldStatus === -1 &&
+ newStatus === -1 &&
+ current.nlink === previous.nlink) return;
+
+ oldStatus = newStatus;
+ self.emit('change', current, previous);
+ };
+
+ this._handle.onstop = function() {
+ self.emit('stop');
+ };
+}
+util.inherits(StatWatcher, EventEmitter);
+
+
+StatWatcher.prototype.start = function(filename, persistent, interval) {
+ nullCheck(filename);
+ this._handle.start(pathModule._makeLong(filename), persistent, interval);
+};
+
+
+StatWatcher.prototype.stop = function() {
+ this._handle.stop();
+};
+
+
+var statWatchers = {};
+function inStatWatchers(filename) {
+ return Object.prototype.hasOwnProperty.call(statWatchers, filename) &&
+ statWatchers[filename];
+}
+
+
+fs.watchFile = function(filename) {
+ nullCheck(filename);
+ var stat;
+ var listener;
+
+ var options = {
+ // Poll interval in milliseconds. 5007 is what libev used to use. It's
+ // a little on the slow side but let's stick with it for now to keep
+ // behavioral changes to a minimum.
+ interval: 5007,
+ persistent: true
+ };
+
+ if ('object' == typeof arguments[1]) {
+ options = util._extend(options, arguments[1]);
+ listener = arguments[2];
+ } else {
+ listener = arguments[1];
+ }
+
+ if (!listener) {
+ throw new Error('watchFile requires a listener function');
+ }
+
+ if (inStatWatchers(filename)) {
+ stat = statWatchers[filename];
+ } else {
+ stat = statWatchers[filename] = new StatWatcher();
+ stat.start(filename, options.persistent, options.interval);
+ }
+ stat.addListener('change', listener);
+ return stat;
+};
+
+fs.unwatchFile = function(filename, listener) {
+ nullCheck(filename);
+ if (!inStatWatchers(filename)) return;
+
+ var stat = statWatchers[filename];
+
+ if (typeof listener === 'function') {
+ stat.removeListener('change', listener);
+ } else {
+ stat.removeAllListeners('change');
+ }
+
+ if (stat.listeners('change').length === 0) {
+ stat.stop();
+ statWatchers[filename] = undefined;
+ }
+};
+
+// Realpath
+// Not using realpath(2) because it's bad.
+// See: http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html
+
+var normalize = pathModule.normalize;
+
+// Regexp that finds the next partion of a (partial) path
+// result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
+if (isWindows) {
+ var nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
+} else {
+ var nextPartRe = /(.*?)(?:[\/]+|$)/g;
+}
+
+// Regex to find the device root, including trailing slash. E.g. 'c:\\'.
+if (isWindows) {
+ var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
+} else {
+ var splitRootRe = /^[\/]*/;
+}
+
+fs.realpathSync = function realpathSync(p, cache) {
+ // make p is absolute
+ p = pathModule.resolve(p);
+
+ if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
+ return cache[p];
+ }
+
+ var original = p,
+ seenLinks = {},
+ knownHard = {};
+
+ // current character position in p
+ var pos;
+ // the partial path so far, including a trailing slash if any
+ var current;
+ // the partial path without a trailing slash (except when pointing at a root)
+ var base;
+ // the partial path scanned in the previous round, with slash
+ var previous;
+
+ start();
+
+ function start() {
+ // Skip over roots
+ var m = splitRootRe.exec(p);
+ pos = m[0].length;
+ current = m[0];
+ base = m[0];
+ previous = '';
+
+ // On windows, check that the root exists. On unix there is no need.
+ if (isWindows && !knownHard[base]) {
+ fs.lstatSync(base);
+ knownHard[base] = true;
+ }
+ }
+
+ // walk down the path, swapping out linked pathparts for their real
+ // values
+ // NB: p.length changes.
+ while (pos < p.length) {
+ // find the next part
+ nextPartRe.lastIndex = pos;
+ var result = nextPartRe.exec(p);
+ previous = current;
+ current += result[0];
+ base = previous + result[1];
+ pos = nextPartRe.lastIndex;
+
+ // continue if not a symlink
+ if (knownHard[base] || (cache && cache[base] === base)) {
+ continue;
+ }
+
+ var resolvedLink;
+ if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
+ // some known symbolic link. no need to stat again.
+ resolvedLink = cache[base];
+ } else {
+ var stat = fs.lstatSync(base);
+ if (!stat.isSymbolicLink()) {
+ knownHard[base] = true;
+ if (cache) cache[base] = base;
+ continue;
+ }
+
+ // read the link if it wasn't read before
+ // dev/ino always return 0 on windows, so skip the check.
+ var linkTarget = null;
+ if (!isWindows) {
+ var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
+ if (seenLinks.hasOwnProperty(id)) {
+ linkTarget = seenLinks[id];
+ }
+ }
+ if (linkTarget === null) {
+ fs.statSync(base);
+ linkTarget = fs.readlinkSync(base);
+ }
+ resolvedLink = pathModule.resolve(previous, linkTarget);
+ // track this, if given a cache.
+ if (cache) cache[base] = resolvedLink;
+ if (!isWindows) seenLinks[id] = linkTarget;
+ }
+
+ // resolve the link, then start over
+ p = pathModule.resolve(resolvedLink, p.slice(pos));
+ start();
+ }
+
+ if (cache) cache[original] = p;
+
+ return p;
+};
+
+
+fs.realpath = function realpath(p, cache, cb) {
+ if (typeof cb !== 'function') {
+ cb = maybeCallback(cache);
+ cache = null;
+ }
+
+ // make p is absolute
+ p = pathModule.resolve(p);
+
+ if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
+ return process.nextTick(cb.bind(null, null, cache[p]));
+ }
+
+ var original = p,
+ seenLinks = {},
+ knownHard = {};
+
+ // current character position in p
+ var pos;
+ // the partial path so far, including a trailing slash if any
+ var current;
+ // the partial path without a trailing slash (except when pointing at a root)
+ var base;
+ // the partial path scanned in the previous round, with slash
+ var previous;
+
+ start();
+
+ function start() {
+ // Skip over roots
+ var m = splitRootRe.exec(p);
+ pos = m[0].length;
+ current = m[0];
+ base = m[0];
+ previous = '';
+
+ // On windows, check that the root exists. On unix there is no need.
+ if (isWindows && !knownHard[base]) {
+ fs.lstat(base, function(err) {
+ if (err) return cb(err);
+ knownHard[base] = true;
+ LOOP();
+ });
+ } else {
+ process.nextTick(LOOP);
+ }
+ }
+
+ // walk down the path, swapping out linked pathparts for their real
+ // values
+ function LOOP() {
+ // stop if scanned past end of path
+ if (pos >= p.length) {
+ if (cache) cache[original] = p;
+ return cb(null, p);
+ }
+
+ // find the next part
+ nextPartRe.lastIndex = pos;
+ var result = nextPartRe.exec(p);
+ previous = current;
+ current += result[0];
+ base = previous + result[1];
+ pos = nextPartRe.lastIndex;
+
+ // continue if not a symlink
+ if (knownHard[base] || (cache && cache[base] === base)) {
+ return process.nextTick(LOOP);
+ }
+
+ if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
+ // known symbolic link. no need to stat again.
+ return gotResolvedLink(cache[base]);
+ }
+
+ return fs.lstat(base, gotStat);
+ }
+
+ function gotStat(err, stat) {
+ if (err) return cb(err);
+
+ // if not a symlink, skip to the next path part
+ if (!stat.isSymbolicLink()) {
+ knownHard[base] = true;
+ if (cache) cache[base] = base;
+ return process.nextTick(LOOP);
+ }
+
+ // stat & read the link if not read before
+ // call gotTarget as soon as the link target is known
+ // dev/ino always return 0 on windows, so skip the check.
+ if (!isWindows) {
+ var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
+ if (seenLinks.hasOwnProperty(id)) {
+ return gotTarget(null, seenLinks[id], base);
+ }
+ }
+ fs.stat(base, function(err) {
+ if (err) return cb(err);
+
+ fs.readlink(base, function(err, target) {
+ if (!isWindows) seenLinks[id] = target;
+ gotTarget(err, target);
+ });
+ });
+ }
+
+ function gotTarget(err, target, base) {
+ if (err) return cb(err);
+
+ var resolvedLink = pathModule.resolve(previous, target);
+ if (cache) cache[base] = resolvedLink;
+ gotResolvedLink(resolvedLink);
+ }
+
+ function gotResolvedLink(resolvedLink) {
+ // resolve the link, then start over
+ p = pathModule.resolve(resolvedLink, p.slice(pos));
+ start();
+ }
+};
+
+
+
+var pool;
+
+function allocNewPool() {
+ pool = new Buffer(kPoolSize);
+ pool.used = 0;
+}
+
+
+
+fs.createReadStream = function(path, options) {
+ return new ReadStream(path, options);
+};
+
+util.inherits(ReadStream, Readable);
+fs.ReadStream = ReadStream;
+
+function ReadStream(path, options) {
+ if (!(this instanceof ReadStream))
+ return new ReadStream(path, options);
+
+ // a little bit bigger buffer and water marks by default
+ options = util._extend({
+ bufferSize: 64 * 1024,
+ lowWaterMark: 16 * 1024,
+ highWaterMark: 64 * 1024
+ }, options || {});
+
+ Readable.call(this, options);
+
+ this.path = path;
+ this.fd = options.hasOwnProperty('fd') ? options.fd : null;
+ this.flags = options.hasOwnProperty('flags') ? options.flags : 'r';
+ this.mode = options.hasOwnProperty('mode') ? options.mode : 438; /*=0666*/
+
+ this.start = options.hasOwnProperty('start') ? options.start : undefined;
+ this.end = options.hasOwnProperty('start') ? options.end : undefined;
+ this.pos = undefined;
+
+ if (this.start !== undefined) {
+ if ('number' !== typeof this.start) {
+ throw TypeError('start must be a Number');
+ }
+ if (this.end === undefined) {
+ this.end = Infinity;
+ } else if ('number' !== typeof this.end) {
+ throw TypeError('end must be a Number');
+ }
+
+ if (this.start > this.end) {
+ throw new Error('start must be <= end');
+ }
+
+ this.pos = this.start;
+ }
+
+ if (typeof this.fd !== 'number')
+ this.open();
+
+ this.on('end', function() {
+ this.destroy();
+ });
+}
+
+fs.FileReadStream = fs.ReadStream; // support the legacy name
+
+ReadStream.prototype.open = function() {
+ var self = this;
+ fs.open(this.path, this.flags, this.mode, function(er, fd) {
+ if (er) {
+ self.destroy();
+ self.emit('error', er);
+ return;
+ }
+
+ self.fd = fd;
+ self.emit('open', fd);
+ // start the flow of data.
+ self.read();
+ });
+};
+
+ReadStream.prototype._read = function(n, cb) {
+ if (typeof this.fd !== 'number')
+ return this.once('open', function() {
+ this._read(n, cb);
+ });
+
+ if (this.destroyed)
+ return;
+
+ if (!pool || pool.length - pool.used < kMinPoolSpace) {
+ // discard the old pool. Can't add to the free list because
+ // users might have refernces to slices on it.
+ pool = null;
+ allocNewPool();
+ }
+
+ // Grab another reference to the pool in the case that while we're
+ // in the thread pool another read() finishes up the pool, and
+ // allocates a new one.
+ var thisPool = pool;
+ var toRead = Math.min(pool.length - pool.used, n);
+ var start = pool.used;
+
+ if (this.pos !== undefined)
+ toRead = Math.min(this.end - this.pos + 1, toRead);
+
+ // already read everything we were supposed to read!
+ // treat as EOF.
+ if (toRead <= 0)
+ return cb();
+
+ // the actual read.
+ var self = this;
+ fs.read(this.fd, pool, pool.used, toRead, this.pos, onread);
+
+ // move the pool positions, and internal position for reading.
+ if (this.pos !== undefined)
+ this.pos += toRead;
+ pool.used += toRead;
+
+ function onread(er, bytesRead) {
+ if (er) {
+ self.destroy();
+ return cb(er);
+ }
+
+ var b = null;
+ if (bytesRead > 0)
+ b = thisPool.slice(start, start + bytesRead);
+
+ cb(null, b);
+ }
+};
+
+
+ReadStream.prototype.destroy = function() {
+ if (this.destroyed)
+ return;
+ this.destroyed = true;
+ if ('number' === typeof this.fd)
+ this.close();
+};
+
+
+ReadStream.prototype.close = function(cb) {
+ if (cb)
+ this.once('close', cb);
+ if (this.closed || 'number' !== typeof this.fd) {
+ if ('number' !== typeof this.fd)
+ this.once('open', close);
+ return process.nextTick(this.emit.bind(this, 'close'));
+ }
+ this.closed = true;
+ var self = this;
+ close();
+
+ function close() {
+ fs.close(self.fd, function(er) {
+ if (er)
+ self.emit('error', er);
+ else
+ self.emit('close');
+ });
+ }
+};
+
+
+
+
+fs.createWriteStream = function(path, options) {
+ return new WriteStream(path, options);
+};
+
+util.inherits(WriteStream, Writable);
+fs.WriteStream = WriteStream;
+function WriteStream(path, options) {
+ if (!(this instanceof WriteStream))
+ return new WriteStream(path, options);
+
+ // a little bit bigger buffer and water marks by default
+ options = util._extend({
+ bufferSize: 64 * 1024,
+ lowWaterMark: 16 * 1024,
+ highWaterMark: 64 * 1024
+ }, options || {});
+
+ Writable.call(this, options);
+
+ this.path = path;
+ this.fd = null;
+
+ this.fd = options.hasOwnProperty('fd') ? options.fd : null;
+ this.flags = options.hasOwnProperty('flags') ? options.flags : 'w';
+ this.mode = options.hasOwnProperty('mode') ? options.mode : 438; /*=0666*/
+
+ this.start = options.hasOwnProperty('start') ? options.start : undefined;
+ this.pos = undefined;
+ this.bytesWritten = 0;
+
+ if (this.start !== undefined) {
+ if ('number' !== typeof this.start) {
+ throw TypeError('start must be a Number');
+ }
+ if (this.start < 0) {
+ throw new Error('start must be >= zero');
+ }
+
+ this.pos = this.start;
+ }
+
+ if ('number' !== typeof this.fd)
+ this.open();
+
+ // dispose on finish.
+ this.once('finish', this.close);
+}
+
+fs.FileWriteStream = fs.WriteStream; // support the legacy name
+
+
+WriteStream.prototype.open = function() {
+ fs.open(this.path, this.flags, this.mode, function(er, fd) {
+ if (er) {
+ this.destroy();
+ this.emit('error', er);
+ return;
+ }
+
+ this.fd = fd;
+ this.emit('open', fd);
+ }.bind(this));
+};
+
+
+WriteStream.prototype._write = function(data, cb) {
+ if (!Buffer.isBuffer(data))
+ return this.emit('error', new Error('Invalid data'));
+
+ if (typeof this.fd !== 'number')
+ return this.once('open', this._write.bind(this, data, cb));
+
+ fs.write(this.fd, data, 0, data.length, this.pos, function(er, bytes) {
+ if (er) {
+ this.destroy();
+ return cb(er);
+ }
+ this.bytesWritten += bytes;
+ cb();
+ }.bind(this));
+
+ if (this.pos !== undefined)
+ this.pos += data.length;
+};
+
+
+WriteStream.prototype.destroy = ReadStream.prototype.destroy;
+WriteStream.prototype.close = ReadStream.prototype.close;
+
+// There is no shutdown() for files.
+WriteStream.prototype.destroySoon = WriteStream.prototype.end;
+
+
+// SyncWriteStream is internal. DO NOT USE.
+// Temporary hack for process.stdout and process.stderr when piped to files.
+function SyncWriteStream(fd) {
+ Stream.call(this);
+
+ this.fd = fd;
+ this.writable = true;
+ this.readable = false;
+}
+
+util.inherits(SyncWriteStream, Stream);
+
+
+// Export
+fs.SyncWriteStream = SyncWriteStream;
+
+
+SyncWriteStream.prototype.write = function(data, arg1, arg2) {
+ var encoding, cb;
+
+ // parse arguments
+ if (arg1) {
+ if (typeof arg1 === 'string') {
+ encoding = arg1;
+ cb = arg2;
+ } else if (typeof arg1 === 'function') {
+ cb = arg1;
+ } else {
+ throw new Error('bad arg');
+ }
+ }
+ assertEncoding(encoding);
+
+ // Change strings to buffers. SLOW
+ if (typeof data == 'string') {
+ data = new Buffer(data, encoding);
+ }
+
+ fs.writeSync(this.fd, data, 0, data.length);
+
+ if (cb) {
+ process.nextTick(cb);
+ }
+
+ return true;
+};
+
+
+SyncWriteStream.prototype.end = function(data, arg1, arg2) {
+ if (data) {
+ this.write(data, arg1, arg2);
+ }
+ this.destroy();
+};
+
+
+SyncWriteStream.prototype.destroy = function() {
+ fs.closeSync(this.fd);
+ this.fd = null;
+ this.emit('close');
+ return true;
+};
+
+SyncWriteStream.prototype.destroySoon = SyncWriteStream.prototype.destroy;
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js
new file mode 100644
index 000000000..a2e0d8e0d
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js
@@ -0,0 +1,69 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+// a duplex stream is just a stream that is both readable and writable.
+// Since JS doesn't have multiple prototypal inheritance, this class
+// prototypally inherits from Readable, and then parasitically from
+// Writable.
+
+module.exports = Duplex;
+var util = require('util');
+var Readable = require('./_stream_readable');
+var Writable = require('./_stream_writable');
+
+util.inherits(Duplex, Readable);
+
+Object.keys(Writable.prototype).forEach(function(method) {
+ if (!Duplex.prototype[method])
+ Duplex.prototype[method] = Writable.prototype[method];
+});
+
+function Duplex(options) {
+ if (!(this instanceof Duplex))
+ return new Duplex(options);
+
+ Readable.call(this, options);
+ Writable.call(this, options);
+
+ if (options && options.readable === false)
+ this.readable = false;
+
+ if (options && options.writable === false)
+ this.writable = false;
+
+ this.allowHalfOpen = true;
+ if (options && options.allowHalfOpen === false)
+ this.allowHalfOpen = false;
+
+ this.once('end', onend);
+}
+
+// the no-half-open enforcer
+function onend() {
+ // if we allow half-open state, or if the writable side ended,
+ // then we're ok.
+ if (this.allowHalfOpen || this._writableState.ended)
+ return;
+
+ // no more data can be written.
+ // But allow more writes to happen in this tick.
+ process.nextTick(this.end.bind(this));
+}
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js
new file mode 100644
index 000000000..330c247d4
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js
@@ -0,0 +1,41 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+// a passthrough stream.
+// basically just the most minimal sort of Transform stream.
+// Every written chunk gets output as-is.
+
+module.exports = PassThrough;
+
+var Transform = require('./_stream_transform');
+var util = require('util');
+util.inherits(PassThrough, Transform);
+
+function PassThrough(options) {
+ if (!(this instanceof PassThrough))
+ return new PassThrough(options);
+
+ Transform.call(this, options);
+}
+
+PassThrough.prototype._transform = function(chunk, encoding, cb) {
+ cb(null, chunk);
+};
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js
new file mode 100644
index 000000000..11580bc40
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js
@@ -0,0 +1,876 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+module.exports = Readable;
+Readable.ReadableState = ReadableState;
+
+var EE = require('events').EventEmitter;
+if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
+ return emitter.listeners(type).length;
+};
+var Stream = require('stream');
+var util = require('util');
+var StringDecoder;
+
+util.inherits(Readable, Stream);
+
+function ReadableState(options, stream) {
+ options = options || {};
+
+ // the point at which it stops calling _read() to fill the buffer
+ // Note: 0 is a valid value, means "don't call _read preemptively ever"
+ var hwm = options.highWaterMark;
+ this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;
+
+ // cast to ints.
+ this.highWaterMark = ~~this.highWaterMark;
+
+ this.buffer = [];
+ this.length = 0;
+ this.pipes = null;
+ this.pipesCount = 0;
+ this.flowing = false;
+ this.ended = false;
+ this.endEmitted = false;
+ this.reading = false;
+
+ // In streams that never have any data, and do push(null) right away,
+ // the consumer can miss the 'end' event if they do some I/O before
+ // consuming the stream. So, we don't emit('end') until some reading
+ // happens.
+ this.calledRead = false;
+
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, becuase any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
+ this.sync = true;
+
+ // whenever we return null, then we set a flag to say
+ // that we're awaiting a 'readable' event emission.
+ this.needReadable = false;
+ this.emittedReadable = false;
+
+
+ // object stream flag. Used to make read(n) ignore n and to
+ // make all the buffer merging and length checks go away
+ this.objectMode = !!options.objectMode;
+
+ // when piping, we only care about 'readable' events that happen
+ // after read()ing all the bytes and not getting any pushback.
+ this.ranOut = false;
+
+ // the number of writers that are awaiting a drain event in .pipe()s
+ this.awaitDrain = 0;
+
+ // if true, a maybeReadMore has been scheduled
+ this.readingMore = false;
+
+ this.decoder = null;
+ if (options.encoding) {
+ if (!StringDecoder)
+ StringDecoder = require('string_decoder').StringDecoder;
+ this.decoder = new StringDecoder(options.encoding);
+ }
+}
+
+function Readable(options) {
+ if (!(this instanceof Readable))
+ return new Readable(options);
+
+ this._readableState = new ReadableState(options, this);
+
+ // legacy
+ this.readable = true;
+
+ Stream.call(this);
+}
+
+// Manually shove something into the read() buffer.
+// This returns true if the highWaterMark has not been hit yet,
+// similar to how Writable.write() returns true if you should
+// write() some more.
+Readable.prototype.push = function(chunk) {
+ var state = this._readableState;
+ if (typeof chunk === 'string' && !state.objectMode)
+ chunk = new Buffer(chunk, arguments[1]);
+ return readableAddChunk(this, state, chunk, false);
+};
+
+Readable.prototype.unshift = function(chunk) {
+ var state = this._readableState;
+ if (typeof chunk === 'string' && !state.objectMode)
+ chunk = new Buffer(chunk, arguments[1]);
+ return readableAddChunk(this, state, chunk, true);
+};
+
+function readableAddChunk(stream, state, chunk, addToFront) {
+ state.reading = false;
+
+ var er = chunkInvalid(state, chunk);
+ if (er) {
+ stream.emit('error', er);
+ } else if (chunk === null || chunk === undefined) {
+ onEofChunk(stream, state);
+ } else if (state.objectMode || chunk && chunk.length > 0) {
+ if (state.decoder)
+ chunk = state.decoder.write(chunk);
+
+ // update the buffer info.
+ state.length += state.objectMode ? 1 : chunk.length;
+ if (addToFront)
+ state.buffer.unshift(chunk);
+ else
+ state.buffer.push(chunk);
+
+ if (state.needReadable)
+ emitReadable(stream);
+
+ maybeReadMore(stream, state);
+ }
+
+ return needMoreData(state);
+}
+
+
+
+// if it's past the high water mark, we can push in some more.
+// Also, if we have no data yet, we can stand some
+// more bytes. This is to work around cases where hwm=0,
+// such as the repl. Also, if the push() triggered a
+// readable event, and the user called read(largeNumber) such that
+// needReadable was set, then we ought to push more, so that another
+// 'readable' event will be triggered.
+function needMoreData(state) {
+ return !state.ended &&
+ (state.needReadable ||
+ state.length < state.highWaterMark ||
+ state.length === 0);
+}
+
+// backwards compatibility.
+Readable.prototype.setEncoding = function(enc) {
+ if (!StringDecoder)
+ StringDecoder = require('string_decoder').StringDecoder;
+ this._readableState.decoder = new StringDecoder(enc);
+};
+
+// Don't raise the hwm > 128MB
+var MAX_HWM = 0x800000;
+function roundUpToNextPowerOf2(n) {
+ if (n >= MAX_HWM) {
+ n = MAX_HWM;
+ } else {
+ // Get the next highest power of 2
+ n--;
+ for (var p = 1; p < 32; p <<= 1) n |= n >> p;
+ n++;
+ }
+ return n;
+}
+
+function howMuchToRead(n, state) {
+ if (state.length === 0 && state.ended)
+ return 0;
+
+ if (state.objectMode)
+ return n === 0 ? 0 : 1;
+
+ if (isNaN(n) || n === null) {
+ // only flow one buffer at a time
+ if (state.flowing && state.buffer.length)
+ return state.buffer[0].length;
+ else
+ return state.length;
+ }
+
+ if (n <= 0)
+ return 0;
+
+ // If we're asking for more than the target buffer level,
+ // then raise the water mark. Bump up to the next highest
+ // power of 2, to prevent increasing it excessively in tiny
+ // amounts.
+ if (n > state.highWaterMark)
+ state.highWaterMark = roundUpToNextPowerOf2(n);
+
+ // don't have that much. return null, unless we've ended.
+ if (n > state.length) {
+ if (!state.ended) {
+ state.needReadable = true;
+ return 0;
+ } else
+ return state.length;
+ }
+
+ return n;
+}
+
+// you can override either this method, or the async _read(n) below.
+Readable.prototype.read = function(n) {
+ var state = this._readableState;
+ state.calledRead = true;
+ var nOrig = n;
+
+ if (typeof n !== 'number' || n > 0)
+ state.emittedReadable = false;
+
+ // if we're doing read(0) to trigger a readable event, but we
+ // already have a bunch of data in the buffer, then just trigger
+ // the 'readable' event and move on.
+ if (n === 0 &&
+ state.needReadable &&
+ state.length >= state.highWaterMark) {
+ emitReadable(this);
+ return null;
+ }
+
+ n = howMuchToRead(n, state);
+
+ // if we've ended, and we're now clear, then finish it up.
+ if (n === 0 && state.ended) {
+ if (state.length === 0)
+ endReadable(this);
+ return null;
+ }
+
+ // All the actual chunk generation logic needs to be
+ // *below* the call to _read. The reason is that in certain
+ // synthetic stream cases, such as passthrough streams, _read
+ // may be a completely synchronous operation which may change
+ // the state of the read buffer, providing enough data when
+ // before there was *not* enough.
+ //
+ // So, the steps are:
+ // 1. Figure out what the state of things will be after we do
+ // a read from the buffer.
+ //
+ // 2. If that resulting state will trigger a _read, then call _read.
+ // Note that this may be asynchronous, or synchronous. Yes, it is
+ // deeply ugly to write APIs this way, but that still doesn't mean
+ // that the Readable class should behave improperly, as streams are
+ // designed to be sync/async agnostic.
+ // Take note if the _read call is sync or async (ie, if the read call
+ // has returned yet), so that we know whether or not it's safe to emit
+ // 'readable' etc.
+ //
+ // 3. Actually pull the requested chunks out of the buffer and return.
+
+ // if we need a readable event, then we need to do some reading.
+ var doRead = state.needReadable;
+
+ // if we currently have less than the highWaterMark, then also read some
+ if (state.length - n <= state.highWaterMark)
+ doRead = true;
+
+ // however, if we've ended, then there's no point, and if we're already
+ // reading, then it's unnecessary.
+ if (state.ended || state.reading)
+ doRead = false;
+
+ if (doRead) {
+ state.reading = true;
+ state.sync = true;
+ // if the length is currently zero, then we *need* a readable event.
+ if (state.length === 0)
+ state.needReadable = true;
+ // call internal read method
+ this._read(state.highWaterMark);
+ state.sync = false;
+ }
+
+ // If _read called its callback synchronously, then `reading`
+ // will be false, and we need to re-evaluate how much data we
+ // can return to the user.
+ if (doRead && !state.reading)
+ n = howMuchToRead(nOrig, state);
+
+ var ret;
+ if (n > 0)
+ ret = fromList(n, state);
+ else
+ ret = null;
+
+ if (ret === null) {
+ state.needReadable = true;
+ n = 0;
+ }
+
+ state.length -= n;
+
+ // If we have nothing in the buffer, then we want to know
+ // as soon as we *do* get something into the buffer.
+ if (state.length === 0 && !state.ended)
+ state.needReadable = true;
+
+ // If we happened to read() exactly the remaining amount in the
+ // buffer, and the EOF has been seen at this point, then make sure
+ // that we emit 'end' on the very next tick.
+ if (state.ended && !state.endEmitted && state.length === 0)
+ endReadable(this);
+
+ return ret;
+};
+
+function chunkInvalid(state, chunk) {
+ var er = null;
+ if (!Buffer.isBuffer(chunk) &&
+ 'string' !== typeof chunk &&
+ chunk !== null &&
+ chunk !== undefined &&
+ !state.objectMode &&
+ !er) {
+ er = new TypeError('Invalid non-string/buffer chunk');
+ }
+ return er;
+}
+
+
+function onEofChunk(stream, state) {
+ state.ended = true;
+ if (state.decoder && state.decoder.end) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length) {
+ state.buffer.push(chunk);
+ state.length += state.objectMode ? 1 : chunk.length;
+ }
+ }
+
+ // if we've ended and we have some data left, then emit
+ // 'readable' now to make sure it gets picked up.
+ if (state.length > 0)
+ emitReadable(stream);
+ else
+ endReadable(stream);
+}
+
+// Don't emit readable right away in sync mode, because this can trigger
+// another read() call => stack overflow. This way, it might trigger
+// a nextTick recursion warning, but that's not so bad.
+function emitReadable(stream) {
+ var state = stream._readableState;
+ state.needReadable = false;
+ if (state.emittedReadable)
+ return;
+
+ state.emittedReadable = true;
+ if (state.sync)
+ process.nextTick(function() {
+ emitReadable_(stream);
+ });
+ else
+ emitReadable_(stream);
+}
+
+function emitReadable_(stream) {
+ var state = stream._readableState;
+ stream.emit('readable');
+}
+
+
+// at this point, the user has presumably seen the 'readable' event,
+// and called read() to consume some data. that may have triggered
+// in turn another _read(n) call, in which case reading = true if
+// it's in progress.
+// However, if we're not ended, or reading, and the length < hwm,
+// then go ahead and try to read some more preemptively.
+function maybeReadMore(stream, state) {
+ if (!state.readingMore) {
+ state.readingMore = true;
+ process.nextTick(function() {
+ maybeReadMore_(stream, state);
+ });
+ }
+}
+
+function maybeReadMore_(stream, state) {
+ var len = state.length;
+ while (!state.reading && !state.flowing && !state.ended &&
+ state.length < state.highWaterMark) {
+ stream.read(0);
+ if (len === state.length)
+ // didn't get any data, stop spinning.
+ break;
+ else
+ len = state.length;
+ }
+ state.readingMore = false;
+}
+
+// abstract method. to be overridden in specific implementation classes.
+// call cb(er, data) where data is <= n in length.
+// for virtual (non-string, non-buffer) streams, "length" is somewhat
+// arbitrary, and perhaps not very meaningful.
+Readable.prototype._read = function(n) {
+ this.emit('error', new Error('not implemented'));
+};
+
+Readable.prototype.pipe = function(dest, pipeOpts) {
+ var src = this;
+ var state = this._readableState;
+
+ switch (state.pipesCount) {
+ case 0:
+ state.pipes = dest;
+ break;
+ case 1:
+ state.pipes = [state.pipes, dest];
+ break;
+ default:
+ state.pipes.push(dest);
+ break;
+ }
+ state.pipesCount += 1;
+
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) &&
+ dest !== process.stdout &&
+ dest !== process.stderr;
+
+ var endFn = doEnd ? onend : cleanup;
+ if (state.endEmitted)
+ process.nextTick(endFn);
+ else
+ src.once('end', endFn);
+
+ dest.on('unpipe', onunpipe);
+ function onunpipe(readable) {
+ if (readable !== src) return;
+ cleanup();
+ }
+
+ function onend() {
+ dest.end();
+ }
+
+ // when the dest drains, it reduces the awaitDrain counter
+ // on the source. This would be more elegant with a .once()
+ // handler in flow(), but adding and removing repeatedly is
+ // too slow.
+ var ondrain = pipeOnDrain(src);
+ dest.on('drain', ondrain);
+
+ function cleanup() {
+ // cleanup event handlers once the pipe is broken
+ dest.removeListener('close', onclose);
+ dest.removeListener('finish', onfinish);
+ dest.removeListener('drain', ondrain);
+ dest.removeListener('error', onerror);
+ dest.removeListener('unpipe', onunpipe);
+ src.removeListener('end', onend);
+ src.removeListener('end', cleanup);
+
+ // if the reader is waiting for a drain event from this
+ // specific writer, then it would cause it to never start
+ // flowing again.
+ // So, if this is awaiting a drain, then we just call it now.
+ // If we don't know, then assume that we are waiting for one.
+ if (!dest._writableState || dest._writableState.needDrain)
+ ondrain();
+ }
+
+ // if the dest has an error, then stop piping into it.
+ // however, don't suppress the throwing behavior for this.
+ function onerror(er) {
+ unpipe();
+ if (EE.listenerCount(dest, 'error') === 0)
+ dest.emit('error', er);
+ }
+ dest.once('error', onerror);
+
+ // Both close and finish should trigger unpipe, but only once.
+ function onclose() {
+ dest.removeListener('finish', onfinish);
+ unpipe();
+ }
+ dest.once('close', onclose);
+ function onfinish() {
+ dest.removeListener('close', onclose);
+ unpipe();
+ }
+ dest.once('finish', onfinish);
+
+ function unpipe() {
+ src.unpipe(dest);
+ }
+
+ // tell the dest that it's being piped to
+ dest.emit('pipe', src);
+
+ // start the flow if it hasn't been started already.
+ if (!state.flowing) {
+ // the handler that waits for readable events after all
+ // the data gets sucked out in flow.
+ // This would be easier to follow with a .once() handler
+ // in flow(), but that is too slow.
+ this.on('readable', pipeOnReadable);
+
+ state.flowing = true;
+ process.nextTick(function() {
+ flow(src);
+ });
+ }
+
+ return dest;
+};
+
+function pipeOnDrain(src) {
+ return function() {
+ var dest = this;
+ var state = src._readableState;
+ state.awaitDrain--;
+ if (state.awaitDrain === 0)
+ flow(src);
+ };
+}
+
+function flow(src) {
+ var state = src._readableState;
+ var chunk;
+ state.awaitDrain = 0;
+
+ function write(dest, i, list) {
+ var written = dest.write(chunk);
+ if (false === written) {
+ state.awaitDrain++;
+ }
+ }
+
+ while (state.pipesCount && null !== (chunk = src.read())) {
+
+ if (state.pipesCount === 1)
+ write(state.pipes, 0, null);
+ else
+ state.pipes.forEach(write);
+
+ src.emit('data', chunk);
+
+ // if anyone needs a drain, then we have to wait for that.
+ if (state.awaitDrain > 0)
+ return;
+ }
+
+ // if every destination was unpiped, either before entering this
+ // function, or in the while loop, then stop flowing.
+ //
+ // NB: This is a pretty rare edge case.
+ if (state.pipesCount === 0) {
+ state.flowing = false;
+
+ // if there were data event listeners added, then switch to old mode.
+ if (EE.listenerCount(src, 'data') > 0)
+ emitDataEvents(src);
+ return;
+ }
+
+ // at this point, no one needed a drain, so we just ran out of data
+ // on the next readable event, start it over again.
+ state.ranOut = true;
+}
+
+function pipeOnReadable() {
+ if (this._readableState.ranOut) {
+ this._readableState.ranOut = false;
+ flow(this);
+ }
+}
+
+
+Readable.prototype.unpipe = function(dest) {
+ var state = this._readableState;
+
+ // if we're not piping anywhere, then do nothing.
+ if (state.pipesCount === 0)
+ return this;
+
+ // just one destination. most common case.
+ if (state.pipesCount === 1) {
+ // passed in one, but it's not the right one.
+ if (dest && dest !== state.pipes)
+ return this;
+
+ if (!dest)
+ dest = state.pipes;
+
+ // got a match.
+ state.pipes = null;
+ state.pipesCount = 0;
+ this.removeListener('readable', pipeOnReadable);
+ state.flowing = false;
+ if (dest)
+ dest.emit('unpipe', this);
+ return this;
+ }
+
+ // slow case. multiple pipe destinations.
+
+ if (!dest) {
+ // remove all.
+ var dests = state.pipes;
+ var len = state.pipesCount;
+ state.pipes = null;
+ state.pipesCount = 0;
+ this.removeListener('readable', pipeOnReadable);
+ state.flowing = false;
+
+ for (var i = 0; i < len; i++)
+ dests[i].emit('unpipe', this);
+ return this;
+ }
+
+ // try to find the right one.
+ var i = state.pipes.indexOf(dest);
+ if (i === -1)
+ return this;
+
+ state.pipes.splice(i, 1);
+ state.pipesCount -= 1;
+ if (state.pipesCount === 1)
+ state.pipes = state.pipes[0];
+
+ dest.emit('unpipe', this);
+
+ return this;
+};
+
+// set up data events if they are asked for
+// Ensure readable listeners eventually get something
+Readable.prototype.on = function(ev, fn) {
+ var res = Stream.prototype.on.call(this, ev, fn);
+
+ if (ev === 'data' && !this._readableState.flowing)
+ emitDataEvents(this);
+
+ if (ev === 'readable' && !this._readableState.reading)
+ this.read(0);
+
+ return res;
+};
+Readable.prototype.addListener = Readable.prototype.on;
+
+// pause() and resume() are remnants of the legacy readable stream API
+// If the user uses them, then switch into old mode.
+Readable.prototype.resume = function() {
+ emitDataEvents(this);
+ this.read(0);
+ this.emit('resume');
+};
+
+Readable.prototype.pause = function() {
+ emitDataEvents(this, true);
+ this.emit('pause');
+};
+
+function emitDataEvents(stream, startPaused) {
+ var state = stream._readableState;
+
+ if (state.flowing) {
+ // https://github.com/isaacs/readable-stream/issues/16
+ throw new Error('Cannot switch to old mode now.');
+ }
+
+ var paused = startPaused || false;
+ var readable = false;
+
+ // convert to an old-style stream.
+ stream.readable = true;
+ stream.pipe = Stream.prototype.pipe;
+ stream.on = stream.addListener = Stream.prototype.on;
+
+ stream.on('readable', function() {
+ readable = true;
+
+ var c;
+ while (!paused && (null !== (c = stream.read())))
+ stream.emit('data', c);
+
+ if (c === null) {
+ readable = false;
+ stream._readableState.needReadable = true;
+ }
+ });
+
+ stream.pause = function() {
+ paused = true;
+ this.emit('pause');
+ };
+
+ stream.resume = function() {
+ paused = false;
+ if (readable)
+ process.nextTick(function() {
+ stream.emit('readable');
+ });
+ else
+ this.read(0);
+ this.emit('resume');
+ };
+
+ // now make it start, just in case it hadn't already.
+ stream.emit('readable');
+}
+
+// wrap an old-style stream as the async data source.
+// This is *not* part of the readable stream interface.
+// It is an ugly unfortunate mess of history.
+Readable.prototype.wrap = function(stream) {
+ var state = this._readableState;
+ var paused = false;
+
+ var self = this;
+ stream.on('end', function() {
+ state.ended = true;
+ if (state.decoder && state.decoder.end) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length)
+ self.push(chunk);
+ }
+
+ self.push(null);
+ });
+
+ stream.on('data', function(chunk) {
+ if (state.decoder)
+ chunk = state.decoder.write(chunk);
+ if (!chunk || !chunk.length)
+ return;
+
+ var ret = self.push(chunk);
+ if (!ret) {
+ paused = true;
+ stream.pause();
+ }
+ });
+
+ // proxy all the other methods.
+ // important when wrapping filters and duplexes.
+ for (var i in stream) {
+ if (typeof stream[i] === 'function' &&
+ typeof this[i] === 'undefined') {
+ this[i] = function(method) { return function() {
+ return stream[method].apply(stream, arguments);
+ }}(i);
+ }
+ }
+
+ // proxy certain important events.
+ var events = ['error', 'close', 'destroy', 'pause', 'resume'];
+ events.forEach(function(ev) {
+ stream.on(ev, self.emit.bind(self, ev));
+ });
+
+ // when we try to consume some more bytes, simply unpause the
+ // underlying stream.
+ self._read = function(n) {
+ if (paused) {
+ stream.resume();
+ paused = false;
+ }
+ };
+};
+
+
+
+// exposed for testing purposes only.
+Readable._fromList = fromList;
+
+// Pluck off n bytes from an array of buffers.
+// Length is the combined lengths of all the buffers in the list.
+function fromList(n, state) {
+ var list = state.buffer;
+ var length = state.length;
+ var stringMode = !!state.decoder;
+ var objectMode = !!state.objectMode;
+ var ret;
+
+ // nothing in the list, definitely empty.
+ if (list.length === 0)
+ return null;
+
+ if (length === 0)
+ ret = null;
+ else if (objectMode)
+ ret = list.shift();
+ else if (!n || n >= length) {
+ // read it all, truncate the array.
+ if (stringMode)
+ ret = list.join('');
+ else
+ ret = Buffer.concat(list, length);
+ list.length = 0;
+ } else {
+ // read just some of it.
+ if (n < list[0].length) {
+ // just take a part of the first list item.
+ // slice is the same for buffers and strings.
+ var buf = list[0];
+ ret = buf.slice(0, n);
+ list[0] = buf.slice(n);
+ } else if (n === list[0].length) {
+ // first list is a perfect match
+ ret = list.shift();
+ } else {
+ // complex case.
+ // we have enough to cover it, but it spans past the first buffer.
+ if (stringMode)
+ ret = '';
+ else
+ ret = new Buffer(n);
+
+ var c = 0;
+ for (var i = 0, l = list.length; i < l && c < n; i++) {
+ var buf = list[0];
+ var cpy = Math.min(n - c, buf.length);
+
+ if (stringMode)
+ ret += buf.slice(0, cpy);
+ else
+ buf.copy(ret, c, 0, cpy);
+
+ if (cpy < buf.length)
+ list[0] = buf.slice(cpy);
+ else
+ list.shift();
+
+ c += cpy;
+ }
+ }
+ }
+
+ return ret;
+}
+
+function endReadable(stream) {
+ var state = stream._readableState;
+
+ // If we get here before consuming all the bytes, then that is a
+ // bug in node. Should never happen.
+ if (state.length > 0)
+ throw new Error('endReadable called on non-empty stream');
+
+ if (!state.endEmitted && state.calledRead) {
+ state.ended = true;
+ state.endEmitted = true;
+ process.nextTick(function() {
+ stream.readable = false;
+ stream.emit('end');
+ });
+ }
+}
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js
new file mode 100644
index 000000000..f0e52b883
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js
@@ -0,0 +1,206 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+
+// a transform stream is a readable/writable stream where you do
+// something with the data. Sometimes it's called a "filter",
+// but that's not a great name for it, since that implies a thing where
+// some bits pass through, and others are simply ignored. (That would
+// be a valid example of a transform, of course.)
+//
+// While the output is causally related to the input, it's not a
+// necessarily symmetric or synchronous transformation. For example,
+// a zlib stream might take multiple plain-text writes(), and then
+// emit a single compressed chunk some time in the future.
+//
+// Here's how this works:
+//
+// The Transform stream has all the aspects of the readable and writable
+// stream classes. When you write(chunk), that calls _write(chunk,cb)
+// internally, and returns false if there's a lot of pending writes
+// buffered up. When you call read(), that calls _read(n) until
+// there's enough pending readable data buffered up.
+//
+// In a transform stream, the written data is placed in a buffer. When
+// _read(n) is called, it transforms the queued up data, calling the
+// buffered _write cb's as it consumes chunks. If consuming a single
+// written chunk would result in multiple output chunks, then the first
+// outputted bit calls the readcb, and subsequent chunks just go into
+// the read buffer, and will cause it to emit 'readable' if necessary.
+//
+// This way, back-pressure is actually determined by the reading side,
+// since _read has to be called to start processing a new chunk. However,
+// a pathological inflate type of transform can cause excessive buffering
+// here. For example, imagine a stream where every byte of input is
+// interpreted as an integer from 0-255, and then results in that many
+// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
+// 1kb of data being output. In this case, you could write a very small
+// amount of input, and end up with a very large amount of output. In
+// such a pathological inflating mechanism, there'd be no way to tell
+// the system to stop doing the transform. A single 4MB write could
+// cause the system to run out of memory.
+//
+// However, even in such a pathological case, only a single written chunk
+// would be consumed, and then the rest would wait (un-transformed) until
+// the results of the previous transformed chunk were consumed.
+
+module.exports = Transform;
+
+var Duplex = require('./_stream_duplex');
+var util = require('util');
+util.inherits(Transform, Duplex);
+
+
+function TransformState(options, stream) {
+ var ts = this;
+
+ this.afterTransform = function(er, data) {
+ return afterTransform(stream, er, data);
+ };
+
+ this.needTransform = false;
+ this.transforming = false;
+ this.writecb = null;
+ this.writechunk = null;
+}
+
+function afterTransform(stream, er, data) {
+ var ts = stream._transformState;
+ ts.transforming = false;
+
+ var cb = ts.writecb;
+
+ if (!cb)
+ return stream.emit('error', new Error('no writecb in Transform class'));
+
+ ts.writechunk = null;
+ ts.writecb = null;
+
+ if (data !== null && data !== undefined)
+ stream.push(data);
+
+ if (cb)
+ cb(er);
+
+ var rs = stream._readableState;
+ if (rs.needReadable || rs.length < rs.highWaterMark) {
+ stream._read(rs.highWaterMark);
+ }
+}
+
+
+function Transform(options) {
+ if (!(this instanceof Transform))
+ return new Transform(options);
+
+ Duplex.call(this, options);
+
+ var ts = this._transformState = new TransformState(options, this);
+
+ // when the writable side finishes, then flush out anything remaining.
+ var stream = this;
+
+ // start out asking for a readable event once data is transformed.
+ this._readableState.needReadable = true;
+
+ // we have implemented the _read method, and done the other things
+ // that Readable wants before the first _read call, so unset the
+ // sync guard flag.
+ this._readableState.sync = false;
+
+ this.once('finish', function() {
+ if ('function' === typeof this._flush)
+ this._flush(function(er) {
+ done(stream, er);
+ });
+ else
+ done(stream);
+ });
+}
+
+Transform.prototype.push = function(chunk) {
+ this._transformState.needTransform = false;
+ return Duplex.prototype.push.call(this, chunk);
+};
+
+// This is the part where you do stuff!
+// override this function in implementation classes.
+// 'chunk' is an input chunk.
+//
+// Call `push(newChunk)` to pass along transformed output
+// to the readable side. You may call 'push' zero or more times.
+//
+// Call `cb(err)` when you are done with this chunk. If you pass
+// an error, then that'll put the hurt on the whole operation. If you
+// never call cb(), then you'll never get another chunk.
+Transform.prototype._transform = function(chunk, output, cb) {
+ throw new Error('not implemented');
+};
+
+Transform.prototype._write = function(chunk, encoding, cb) {
+ var ts = this._transformState;
+ ts.writecb = cb;
+ ts.writechunk = chunk;
+ ts.writeencoding = encoding;
+ if (!ts.transforming) {
+ var rs = this._readableState;
+ if (ts.needTransform ||
+ rs.needReadable ||
+ rs.length < rs.highWaterMark)
+ this._read(rs.highWaterMark);
+ }
+};
+
+// Doesn't matter what the args are here.
+// the output and callback functions passed to _transform do all the work.
+// That we got here means that the readable side wants more data.
+Transform.prototype._read = function(n) {
+ var ts = this._transformState;
+
+ if (ts.writechunk && ts.writecb && !ts.transforming) {
+ ts.transforming = true;
+ this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
+ } else {
+ // mark that we need a transform, so that any data that comes in
+ // will get processed, now that we've asked for it.
+ ts.needTransform = true;
+ }
+};
+
+
+function done(stream, er) {
+ if (er)
+ return stream.emit('error', er);
+
+ // if there's nothing in the write buffer, then that means
+ // that nothing more will ever be provided
+ var ws = stream._writableState;
+ var rs = stream._readableState;
+ var ts = stream._transformState;
+
+ if (ws.length)
+ throw new Error('calling transform done when ws.length != 0');
+
+ if (ts.transforming)
+ throw new Error('calling transform done when still transforming');
+
+ return stream.push(null);
+}
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js
new file mode 100644
index 000000000..b689be9f8
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js
@@ -0,0 +1,347 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+// A bit simpler than readable streams.
+// Implement an async ._write(chunk, cb), and it'll handle all
+// the drain event emission and buffering.
+
+module.exports = Writable;
+Writable.WritableState = WritableState;
+
+var util = require('util');
+var assert = require('assert');
+var Stream = require('stream');
+
+util.inherits(Writable, Stream);
+
+function WriteReq(chunk, encoding, cb) {
+ this.chunk = chunk;
+ this.encoding = encoding;
+ this.callback = cb;
+}
+
+function WritableState(options, stream) {
+ options = options || {};
+
+ // the point at which write() starts returning false
+ // Note: 0 is a valid value, means that we always return false if
+ // the entire buffer is not flushed immediately on write()
+ var hwm = options.highWaterMark;
+ this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;
+
+ // object stream flag to indicate whether or not this stream
+ // contains buffers or objects.
+ this.objectMode = !!options.objectMode;
+
+ // cast to ints.
+ this.highWaterMark = ~~this.highWaterMark;
+
+ this.needDrain = false;
+ // at the start of calling end()
+ this.ending = false;
+ // when end() has been called, and returned
+ this.ended = false;
+ // when 'finish' is emitted
+ this.finished = false;
+
+ // should we decode strings into buffers before passing to _write?
+ // this is here so that some node-core streams can optimize string
+ // handling at a lower level.
+ var noDecode = options.decodeStrings === false;
+ this.decodeStrings = !noDecode;
+
+ // not an actual buffer we keep track of, but a measurement
+ // of how much we're waiting to get pushed to some underlying
+ // socket or file.
+ this.length = 0;
+
+ // a flag to see when we're in the middle of a write.
+ this.writing = false;
+
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, becuase any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
+ this.sync = true;
+
+ // a flag to know if we're processing previously buffered items, which
+ // may call the _write() callback in the same tick, so that we don't
+ // end up in an overlapped onwrite situation.
+ this.bufferProcessing = false;
+
+ // the callback that's passed to _write(chunk,cb)
+ this.onwrite = function(er) {
+ onwrite(stream, er);
+ };
+
+ // the callback that the user supplies to write(chunk,encoding,cb)
+ this.writecb = null;
+
+ // the amount that is being written when _write is called.
+ this.writelen = 0;
+
+ this.buffer = [];
+}
+
+function Writable(options) {
+ // Writable ctor is applied to Duplexes, though they're not
+ // instanceof Writable, they're instanceof Readable.
+ if (!(this instanceof Writable) && !(this instanceof require('./_stream_duplex')))
+ return new Writable(options);
+
+ this._writableState = new WritableState(options, this);
+
+ // legacy.
+ this.writable = true;
+
+ Stream.call(this);
+}
+
+// Otherwise people can pipe Writable streams, which is just wrong.
+Writable.prototype.pipe = function() {
+ this.emit('error', new Error('Cannot pipe. Not readable.'));
+};
+
+
+function writeAfterEnd(stream, state, cb) {
+ var er = new Error('write after end');
+ // TODO: defer error events consistently everywhere, not just the cb
+ stream.emit('error', er);
+ process.nextTick(function() {
+ cb(er);
+ });
+}
+
+// If we get something that is not a buffer, string, null, or undefined,
+// and we're not in objectMode, then that's an error.
+// Otherwise stream chunks are all considered to be of length=1, and the
+// watermarks determine how many objects to keep in the buffer, rather than
+// how many bytes or characters.
+function validChunk(stream, state, chunk, cb) {
+ var valid = true;
+ if (!Buffer.isBuffer(chunk) &&
+ 'string' !== typeof chunk &&
+ chunk !== null &&
+ chunk !== undefined &&
+ !state.objectMode) {
+ var er = new TypeError('Invalid non-string/buffer chunk');
+ stream.emit('error', er);
+ process.nextTick(function() {
+ cb(er);
+ });
+ valid = false;
+ }
+ return valid;
+}
+
+Writable.prototype.write = function(chunk, encoding, cb) {
+ var state = this._writableState;
+ var ret = false;
+
+ if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+ if (!encoding)
+ encoding = 'utf8';
+
+ if (typeof cb !== 'function')
+ cb = function() {};
+
+ if (state.ended)
+ writeAfterEnd(this, state, cb);
+ else if (validChunk(this, state, chunk, cb))
+ ret = writeOrBuffer(this, state, chunk, encoding, cb);
+
+ return ret;
+};
+
+function decodeChunk(state, chunk, encoding) {
+ if (!state.objectMode &&
+ state.decodeStrings !== false &&
+ typeof chunk === 'string') {
+ chunk = new Buffer(chunk, encoding);
+ }
+ return chunk;
+}
+
+// if we're already writing something, then just put this
+// in the queue, and wait our turn. Otherwise, call _write
+// If we return false, then we need a drain event, so set that flag.
+function writeOrBuffer(stream, state, chunk, encoding, cb) {
+ chunk = decodeChunk(state, chunk, encoding);
+ var len = state.objectMode ? 1 : chunk.length;
+
+ state.length += len;
+
+ var ret = state.length < state.highWaterMark;
+ state.needDrain = !ret;
+
+ if (state.writing)
+ state.buffer.push(new WriteReq(chunk, encoding, cb));
+ else
+ doWrite(stream, state, len, chunk, encoding, cb);
+
+ return ret;
+}
+
+function doWrite(stream, state, len, chunk, encoding, cb) {
+ state.writelen = len;
+ state.writecb = cb;
+ state.writing = true;
+ state.sync = true;
+ stream._write(chunk, encoding, state.onwrite);
+ state.sync = false;
+}
+
+function onwriteError(stream, state, sync, er, cb) {
+ if (sync)
+ process.nextTick(function() {
+ cb(er);
+ });
+ else
+ cb(er);
+
+ stream.emit('error', er);
+}
+
+function onwriteStateUpdate(state) {
+ state.writing = false;
+ state.writecb = null;
+ state.length -= state.writelen;
+ state.writelen = 0;
+}
+
+function onwrite(stream, er) {
+ var state = stream._writableState;
+ var sync = state.sync;
+ var cb = state.writecb;
+
+ onwriteStateUpdate(state);
+
+ if (er)
+ onwriteError(stream, state, sync, er, cb);
+ else {
+ var finished = finishMaybe(stream, state);
+
+ if (!finished && !state.bufferProcessing && state.buffer.length)
+ clearBuffer(stream, state);
+
+ if (sync) {
+ process.nextTick(function() {
+ afterWrite(stream, state, finished, cb);
+ });
+ } else {
+ afterWrite(stream, state, finished, cb);
+ }
+ }
+}
+
+function afterWrite(stream, state, finished, cb) {
+ if (!finished)
+ onwriteDrain(stream, state);
+ cb();
+}
+
+// Must force callback to be called on nextTick, so that we don't
+// emit 'drain' before the write() consumer gets the 'false' return
+// value, and has a chance to attach a 'drain' listener.
+function onwriteDrain(stream, state) {
+ if (state.length === 0 && state.needDrain) {
+ state.needDrain = false;
+ stream.emit('drain');
+ }
+}
+
+
+// if there's something in the buffer waiting, then process it
+function clearBuffer(stream, state) {
+ state.bufferProcessing = true;
+
+ for (var c = 0; c < state.buffer.length; c++) {
+ var entry = state.buffer[c];
+ var chunk = entry.chunk;
+ var encoding = entry.encoding;
+ var cb = entry.callback;
+ var len = state.objectMode ? 1 : chunk.length;
+
+ doWrite(stream, state, len, chunk, encoding, cb);
+
+ // if we didn't call the onwrite immediately, then
+ // it means that we need to wait until it does.
+ // also, that means that the chunk and cb are currently
+ // being processed, so move the buffer counter past them.
+ if (state.writing) {
+ c++;
+ break;
+ }
+ }
+
+ state.bufferProcessing = false;
+ if (c < state.buffer.length)
+ state.buffer = state.buffer.slice(c);
+ else
+ state.buffer.length = 0;
+}
+
+Writable.prototype._write = function(chunk, encoding, cb) {
+ cb(new Error('not implemented'));
+};
+
+Writable.prototype.end = function(chunk, encoding, cb) {
+ var state = this._writableState;
+
+ if (typeof chunk === 'function') {
+ cb = chunk;
+ chunk = null;
+ encoding = null;
+ } else if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (typeof chunk !== 'undefined' && chunk !== null)
+ this.write(chunk, encoding);
+
+ // ignore unnecessary end() calls.
+ if (!state.ending && !state.finished)
+ endWritable(this, state, cb);
+};
+
+function finishMaybe(stream, state) {
+ if (state.ending && state.length === 0 && !state.finished) {
+ state.finished = true;
+ stream.emit('finish');
+ }
+ return state.finished;
+}
+
+function endWritable(stream, state, cb) {
+ state.ending = true;
+ finishMaybe(stream, state);
+ if (cb) {
+ if (state.finished)
+ process.nextTick(cb);
+ else
+ stream.once('finish', cb);
+ }
+ state.ended = true;
+}
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/package.json
new file mode 100644
index 000000000..066d29eb2
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/package.json
@@ -0,0 +1,35 @@
+{
+ "name": "readable-stream",
+ "version": "1.0.2",
+ "description": "An exploration of a new kind of readable streams for Node.js",
+ "main": "readable.js",
+ "dependencies": {},
+ "devDependencies": {
+ "tap": "~0.2.6"
+ },
+ "scripts": {
+ "test": "tap test/simple/*.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/readable-stream"
+ },
+ "keywords": [
+ "readable",
+ "stream",
+ "pipe"
+ ],
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me/"
+ },
+ "license": "BSD",
+ "readme": "# readable-stream\n\nA new class of streams for Node.js\n\nThis module provides the new Stream base classes introduced in Node\nv0.10, for use in Node v0.8. You can use it to have programs that\nhave to work with node v0.8, while being forward-compatible for v0.10\nand beyond. When you drop support for v0.8, you can remove this\nmodule, and only use the native streams.\n\nThis is almost exactly the same codebase as appears in Node v0.10.\nHowever:\n\n1. The exported object is actually the Readable class. Decorating the\n native `stream` module would be global pollution.\n2. In v0.10, you can safely use `base64` as an argument to\n `setEncoding` in Readable streams. However, in v0.8, the\n StringDecoder class has no `end()` method, which is problematic for\n Base64. So, don't use that, because it'll break and be weird.\n\nOther than that, the API is the same as `require('stream')` in v0.10,\nso the API docs are reproduced below.\n\n----------\n\n Stability: 2 - Unstable\n\nA stream is an abstract interface implemented by various objects in\nNode. For example a request to an HTTP server is a stream, as is\nstdout. Streams are readable, writable, or both. All streams are\ninstances of [EventEmitter][]\n\nYou can load the Stream base classes by doing `require('stream')`.\nThere are base classes provided for Readable streams, Writable\nstreams, Duplex streams, and Transform streams.\n\n## Compatibility\n\nIn earlier versions of Node, the Readable stream interface was\nsimpler, but also less powerful and less useful.\n\n* Rather than waiting for you to call the `read()` method, `'data'`\n events would start emitting immediately. If you needed to do some\n I/O to decide how to handle data, then you had to store the chunks\n in some kind of buffer so that they would not be lost.\n* The `pause()` method was advisory, rather than guaranteed. This\n meant that you still had to be prepared to receive `'data'` events\n even when the stream was in a paused state.\n\nIn Node v0.10, the Readable class described below was added. For\nbackwards compatibility with older Node programs, Readable streams\nswitch into \"old mode\" when a `'data'` event handler is added, or when\nthe `pause()` or `resume()` methods are called. The effect is that,\neven if you are not using the new `read()` method and `'readable'`\nevent, you no longer have to worry about losing `'data'` chunks.\n\nMost programs will continue to function normally. However, this\nintroduces an edge case in the following conditions:\n\n* No `'data'` event handler is added.\n* The `pause()` and `resume()` methods are never called.\n\nFor example, consider the following code:\n\n```javascript\n// WARNING! BROKEN!\nnet.createServer(function(socket) {\n\n // we add an 'end' method, but never consume the data\n socket.on('end', function() {\n // It will never get here.\n socket.end('I got your message (but didnt read it)\\n');\n });\n\n}).listen(1337);\n```\n\nIn versions of node prior to v0.10, the incoming message data would be\nsimply discarded. However, in Node v0.10 and beyond, the socket will\nremain paused forever.\n\nThe workaround in this situation is to call the `resume()` method to\ntrigger \"old mode\" behavior:\n\n```javascript\n// Workaround\nnet.createServer(function(socket) {\n\n socket.on('end', function() {\n socket.end('I got your message (but didnt read it)\\n');\n });\n\n // start the flow of data, discarding it.\n socket.resume();\n\n}).listen(1337);\n```\n\nIn addition to new Readable streams switching into old-mode, pre-v0.10\nstyle streams can be wrapped in a Readable class using the `wrap()`\nmethod.\n\n## Class: stream.Readable\n\n<!--type=class-->\n\nA `Readable Stream` has the following methods, members, and events.\n\nNote that `stream.Readable` is an abstract class designed to be\nextended with an underlying implementation of the `_read(size)`\nmethod. (See below.)\n\n### new stream.Readable([options])\n\n* `options` {Object}\n * `highWaterMark` {Number} The maximum number of bytes to store in\n the internal buffer before ceasing to read from the underlying\n resource. Default=16kb\n * `encoding` {String} If specified, then buffers will be decoded to\n strings using the specified encoding. Default=null\n * `objectMode` {Boolean} Whether this stream should behave\n as a stream of objects. Meaning that stream.read(n) returns\n a single value instead of a Buffer of size n\n\nIn classes that extend the Readable class, make sure to call the\nconstructor so that the buffering settings can be properly\ninitialized.\n\n### readable.\\_read(size)\n\n* `size` {Number} Number of bytes to read asynchronously\n\nNote: **This function should NOT be called directly.** It should be\nimplemented by child classes, and called by the internal Readable\nclass methods only.\n\nAll Readable stream implementations must provide a `_read` method\nto fetch data from the underlying resource.\n\nThis method is prefixed with an underscore because it is internal to\nthe class that defines it, and should not be called directly by user\nprograms. However, you **are** expected to override this method in\nyour own extension classes.\n\nWhen data is available, put it into the read queue by calling\n`readable.push(chunk)`. If `push` returns false, then you should stop\nreading. When `_read` is called again, you should start pushing more\ndata.\n\nThe `size` argument is advisory. Implementations where a \"read\" is a\nsingle call that returns data can use this to know how much data to\nfetch. Implementations where that is not relevant, such as TCP or\nTLS, may ignore this argument, and simply provide data whenever it\nbecomes available. There is no need, for example to \"wait\" until\n`size` bytes are available before calling `stream.push(chunk)`.\n\n### readable.push(chunk)\n\n* `chunk` {Buffer | null | String} Chunk of data to push into the read queue\n* return {Boolean} Whether or not more pushes should be performed\n\nNote: **This function should be called by Readable implementors, NOT\nby consumers of Readable subclasses.** The `_read()` function will not\nbe called again until at least one `push(chunk)` call is made. If no\ndata is available, then you MAY call `push('')` (an empty string) to\nallow a future `_read` call, without adding any data to the queue.\n\nThe `Readable` class works by putting data into a read queue to be\npulled out later by calling the `read()` method when the `'readable'`\nevent fires.\n\nThe `push()` method will explicitly insert some data into the read\nqueue. If it is called with `null` then it will signal the end of the\ndata.\n\nIn some cases, you may be wrapping a lower-level source which has some\nsort of pause/resume mechanism, and a data callback. In those cases,\nyou could wrap the low-level source object by doing something like\nthis:\n\n```javascript\n// source is an object with readStop() and readStart() methods,\n// and an `ondata` member that gets called when it has data, and\n// an `onend` member that gets called when the data is over.\n\nvar stream = new Readable();\n\nsource.ondata = function(chunk) {\n // if push() returns false, then we need to stop reading from source\n if (!stream.push(chunk))\n source.readStop();\n};\n\nsource.onend = function() {\n stream.push(null);\n};\n\n// _read will be called when the stream wants to pull more data in\n// the advisory size argument is ignored in this case.\nstream._read = function(n) {\n source.readStart();\n};\n```\n\n### readable.unshift(chunk)\n\n* `chunk` {Buffer | null | String} Chunk of data to unshift onto the read queue\n* return {Boolean} Whether or not more pushes should be performed\n\nThis is the corollary of `readable.push(chunk)`. Rather than putting\nthe data at the *end* of the read queue, it puts it at the *front* of\nthe read queue.\n\nThis is useful in certain use-cases where a stream is being consumed\nby a parser, which needs to \"un-consume\" some data that it has\noptimistically pulled out of the source.\n\n```javascript\n// A parser for a simple data protocol.\n// The \"header\" is a JSON object, followed by 2 \\n characters, and\n// then a message body.\n//\n// Note: This can be done more simply as a Transform stream. See below.\n\nfunction SimpleProtocol(source, options) {\n if (!(this instanceof SimpleProtocol))\n return new SimpleProtocol(options);\n\n Readable.call(this, options);\n this._inBody = false;\n this._sawFirstCr = false;\n\n // source is a readable stream, such as a socket or file\n this._source = source;\n\n var self = this;\n source.on('end', function() {\n self.push(null);\n });\n\n // give it a kick whenever the source is readable\n // read(0) will not consume any bytes\n source.on('readable', function() {\n self.read(0);\n });\n\n this._rawHeader = [];\n this.header = null;\n}\n\nSimpleProtocol.prototype = Object.create(\n Readable.prototype, { constructor: { value: SimpleProtocol }});\n\nSimpleProtocol.prototype._read = function(n) {\n if (!this._inBody) {\n var chunk = this._source.read();\n\n // if the source doesn't have data, we don't have data yet.\n if (chunk === null)\n return this.push('');\n\n // check if the chunk has a \\n\\n\n var split = -1;\n for (var i = 0; i < chunk.length; i++) {\n if (chunk[i] === 10) { // '\\n'\n if (this._sawFirstCr) {\n split = i;\n break;\n } else {\n this._sawFirstCr = true;\n }\n } else {\n this._sawFirstCr = false;\n }\n }\n\n if (split === -1) {\n // still waiting for the \\n\\n\n // stash the chunk, and try again.\n this._rawHeader.push(chunk);\n this.push('');\n } else {\n this._inBody = true;\n var h = chunk.slice(0, split);\n this._rawHeader.push(h);\n var header = Buffer.concat(this._rawHeader).toString();\n try {\n this.header = JSON.parse(header);\n } catch (er) {\n this.emit('error', new Error('invalid simple protocol data'));\n return;\n }\n // now, because we got some extra data, unshift the rest\n // back into the read queue so that our consumer will see it.\n var b = chunk.slice(split);\n this.unshift(b);\n\n // and let them know that we are done parsing the header.\n this.emit('header', this.header);\n }\n } else {\n // from there on, just provide the data to our consumer.\n // careful not to push(null), since that would indicate EOF.\n var chunk = this._source.read();\n if (chunk) this.push(chunk);\n }\n};\n\n// Usage:\nvar parser = new SimpleProtocol(source);\n// Now parser is a readable stream that will emit 'header'\n// with the parsed header data.\n```\n\n### readable.wrap(stream)\n\n* `stream` {Stream} An \"old style\" readable stream\n\nIf you are using an older Node library that emits `'data'` events and\nhas a `pause()` method that is advisory only, then you can use the\n`wrap()` method to create a Readable stream that uses the old stream\nas its data source.\n\nFor example:\n\n```javascript\nvar OldReader = require('./old-api-module.js').OldReader;\nvar oreader = new OldReader;\nvar Readable = require('stream').Readable;\nvar myReader = new Readable().wrap(oreader);\n\nmyReader.on('readable', function() {\n myReader.read(); // etc.\n});\n```\n\n### Event: 'readable'\n\nWhen there is data ready to be consumed, this event will fire.\n\nWhen this event emits, call the `read()` method to consume the data.\n\n### Event: 'end'\n\nEmitted when the stream has received an EOF (FIN in TCP terminology).\nIndicates that no more `'data'` events will happen. If the stream is\nalso writable, it may be possible to continue writing.\n\n### Event: 'data'\n\nThe `'data'` event emits either a `Buffer` (by default) or a string if\n`setEncoding()` was used.\n\nNote that adding a `'data'` event listener will switch the Readable\nstream into \"old mode\", where data is emitted as soon as it is\navailable, rather than waiting for you to call `read()` to consume it.\n\n### Event: 'error'\n\nEmitted if there was an error receiving data.\n\n### Event: 'close'\n\nEmitted when the underlying resource (for example, the backing file\ndescriptor) has been closed. Not all streams will emit this.\n\n### readable.setEncoding(encoding)\n\nMakes the `'data'` event emit a string instead of a `Buffer`. `encoding`\ncan be `'utf8'`, `'utf16le'` (`'ucs2'`), `'ascii'`, or `'hex'`.\n\nThe encoding can also be set by specifying an `encoding` field to the\nconstructor.\n\n### readable.read([size])\n\n* `size` {Number | null} Optional number of bytes to read.\n* Return: {Buffer | String | null}\n\nNote: **This function SHOULD be called by Readable stream users.**\n\nCall this method to consume data once the `'readable'` event is\nemitted.\n\nThe `size` argument will set a minimum number of bytes that you are\ninterested in. If not set, then the entire content of the internal\nbuffer is returned.\n\nIf there is no data to consume, or if there are fewer bytes in the\ninternal buffer than the `size` argument, then `null` is returned, and\na future `'readable'` event will be emitted when more is available.\n\nCalling `stream.read(0)` will always return `null`, and will trigger a\nrefresh of the internal buffer, but otherwise be a no-op.\n\n### readable.pipe(destination, [options])\n\n* `destination` {Writable Stream}\n* `options` {Object} Optional\n * `end` {Boolean} Default=true\n\nConnects this readable stream to `destination` WriteStream. Incoming\ndata on this stream gets written to `destination`. Properly manages\nback-pressure so that a slow destination will not be overwhelmed by a\nfast readable stream.\n\nThis function returns the `destination` stream.\n\nFor example, emulating the Unix `cat` command:\n\n process.stdin.pipe(process.stdout);\n\nBy default `end()` is called on the destination when the source stream\nemits `end`, so that `destination` is no longer writable. Pass `{ end:\nfalse }` as `options` to keep the destination stream open.\n\nThis keeps `writer` open so that \"Goodbye\" can be written at the\nend.\n\n reader.pipe(writer, { end: false });\n reader.on(\"end\", function() {\n writer.end(\"Goodbye\\n\");\n });\n\nNote that `process.stderr` and `process.stdout` are never closed until\nthe process exits, regardless of the specified options.\n\n### readable.unpipe([destination])\n\n* `destination` {Writable Stream} Optional\n\nUndo a previously established `pipe()`. If no destination is\nprovided, then all previously established pipes are removed.\n\n### readable.pause()\n\nSwitches the readable stream into \"old mode\", where data is emitted\nusing a `'data'` event rather than being buffered for consumption via\nthe `read()` method.\n\nCeases the flow of data. No `'data'` events are emitted while the\nstream is in a paused state.\n\n### readable.resume()\n\nSwitches the readable stream into \"old mode\", where data is emitted\nusing a `'data'` event rather than being buffered for consumption via\nthe `read()` method.\n\nResumes the incoming `'data'` events after a `pause()`.\n\n\n## Class: stream.Writable\n\n<!--type=class-->\n\nA `Writable` Stream has the following methods, members, and events.\n\nNote that `stream.Writable` is an abstract class designed to be\nextended with an underlying implementation of the\n`_write(chunk, encoding, cb)` method. (See below.)\n\n### new stream.Writable([options])\n\n* `options` {Object}\n * `highWaterMark` {Number} Buffer level when `write()` starts\n returning false. Default=16kb\n * `decodeStrings` {Boolean} Whether or not to decode strings into\n Buffers before passing them to `_write()`. Default=true\n\nIn classes that extend the Writable class, make sure to call the\nconstructor so that the buffering settings can be properly\ninitialized.\n\n### writable.\\_write(chunk, encoding, callback)\n\n* `chunk` {Buffer | String} The chunk to be written. Will always\n be a buffer unless the `decodeStrings` option was set to `false`.\n* `encoding` {String} If the chunk is a string, then this is the\n encoding type. Ignore chunk is a buffer. Note that chunk will\n **always** be a buffer unless the `decodeStrings` option is\n explicitly set to `false`.\n* `callback` {Function} Call this function (optionally with an error\n argument) when you are done processing the supplied chunk.\n\nAll Writable stream implementations must provide a `_write` method to\nsend data to the underlying resource.\n\nNote: **This function MUST NOT be called directly.** It should be\nimplemented by child classes, and called by the internal Writable\nclass methods only.\n\nCall the callback using the standard `callback(error)` pattern to\nsignal that the write completed successfully or with an error.\n\nIf the `decodeStrings` flag is set in the constructor options, then\n`chunk` may be a string rather than a Buffer, and `encoding` will\nindicate the sort of string that it is. This is to support\nimplementations that have an optimized handling for certain string\ndata encodings. If you do not explicitly set the `decodeStrings`\noption to `false`, then you can safely ignore the `encoding` argument,\nand assume that `chunk` will always be a Buffer.\n\nThis method is prefixed with an underscore because it is internal to\nthe class that defines it, and should not be called directly by user\nprograms. However, you **are** expected to override this method in\nyour own extension classes.\n\n\n### writable.write(chunk, [encoding], [callback])\n\n* `chunk` {Buffer | String} Data to be written\n* `encoding` {String} Optional. If `chunk` is a string, then encoding\n defaults to `'utf8'`\n* `callback` {Function} Optional. Called when this chunk is\n successfully written.\n* Returns {Boolean}\n\nWrites `chunk` to the stream. Returns `true` if the data has been\nflushed to the underlying resource. Returns `false` to indicate that\nthe buffer is full, and the data will be sent out in the future. The\n`'drain'` event will indicate when the buffer is empty again.\n\nThe specifics of when `write()` will return false, is determined by\nthe `highWaterMark` option provided to the constructor.\n\n### writable.end([chunk], [encoding], [callback])\n\n* `chunk` {Buffer | String} Optional final data to be written\n* `encoding` {String} Optional. If `chunk` is a string, then encoding\n defaults to `'utf8'`\n* `callback` {Function} Optional. Called when the final chunk is\n successfully written.\n\nCall this method to signal the end of the data being written to the\nstream.\n\n### Event: 'drain'\n\nEmitted when the stream's write queue empties and it's safe to write\nwithout buffering again. Listen for it when `stream.write()` returns\n`false`.\n\n### Event: 'close'\n\nEmitted when the underlying resource (for example, the backing file\ndescriptor) has been closed. Not all streams will emit this.\n\n### Event: 'finish'\n\nWhen `end()` is called and there are no more chunks to write, this\nevent is emitted.\n\n### Event: 'pipe'\n\n* `source` {Readable Stream}\n\nEmitted when the stream is passed to a readable stream's pipe method.\n\n### Event 'unpipe'\n\n* `source` {Readable Stream}\n\nEmitted when a previously established `pipe()` is removed using the\nsource Readable stream's `unpipe()` method.\n\n## Class: stream.Duplex\n\n<!--type=class-->\n\nA \"duplex\" stream is one that is both Readable and Writable, such as a\nTCP socket connection.\n\nNote that `stream.Duplex` is an abstract class designed to be\nextended with an underlying implementation of the `_read(size)`\nand `_write(chunk, encoding, callback)` methods as you would with a Readable or\nWritable stream class.\n\nSince JavaScript doesn't have multiple prototypal inheritance, this\nclass prototypally inherits from Readable, and then parasitically from\nWritable. It is thus up to the user to implement both the lowlevel\n`_read(n)` method as well as the lowlevel `_write(chunk, encoding, cb)` method\non extension duplex classes.\n\n### new stream.Duplex(options)\n\n* `options` {Object} Passed to both Writable and Readable\n constructors. Also has the following fields:\n * `allowHalfOpen` {Boolean} Default=true. If set to `false`, then\n the stream will automatically end the readable side when the\n writable side ends and vice versa.\n\nIn classes that extend the Duplex class, make sure to call the\nconstructor so that the buffering settings can be properly\ninitialized.\n\n## Class: stream.Transform\n\nA \"transform\" stream is a duplex stream where the output is causally\nconnected in some way to the input, such as a zlib stream or a crypto\nstream.\n\nThere is no requirement that the output be the same size as the input,\nthe same number of chunks, or arrive at the same time. For example, a\nHash stream will only ever have a single chunk of output which is\nprovided when the input is ended. A zlib stream will either produce\nmuch smaller or much larger than its input.\n\nRather than implement the `_read()` and `_write()` methods, Transform\nclasses must implement the `_transform()` method, and may optionally\nalso implement the `_flush()` method. (See below.)\n\n### new stream.Transform([options])\n\n* `options` {Object} Passed to both Writable and Readable\n constructors.\n\nIn classes that extend the Transform class, make sure to call the\nconstructor so that the buffering settings can be properly\ninitialized.\n\n### transform.\\_transform(chunk, encoding, callback)\n\n* `chunk` {Buffer | String} The chunk to be transformed. Will always\n be a buffer unless the `decodeStrings` option was set to `false`.\n* `encoding` {String} If the chunk is a string, then this is the\n encoding type. (Ignore if `decodeStrings` chunk is a buffer.)\n* `callback` {Function} Call this function (optionally with an error\n argument) when you are done processing the supplied chunk.\n\nNote: **This function MUST NOT be called directly.** It should be\nimplemented by child classes, and called by the internal Transform\nclass methods only.\n\nAll Transform stream implementations must provide a `_transform`\nmethod to accept input and produce output.\n\n`_transform` should do whatever has to be done in this specific\nTransform class, to handle the bytes being written, and pass them off\nto the readable portion of the interface. Do asynchronous I/O,\nprocess things, and so on.\n\nCall `transform.push(outputChunk)` 0 or more times to generate output\nfrom this input chunk, depending on how much data you want to output\nas a result of this chunk.\n\nCall the callback function only when the current chunk is completely\nconsumed. Note that there may or may not be output as a result of any\nparticular input chunk.\n\nThis method is prefixed with an underscore because it is internal to\nthe class that defines it, and should not be called directly by user\nprograms. However, you **are** expected to override this method in\nyour own extension classes.\n\n### transform.\\_flush(callback)\n\n* `callback` {Function} Call this function (optionally with an error\n argument) when you are done flushing any remaining data.\n\nNote: **This function MUST NOT be called directly.** It MAY be implemented\nby child classes, and if so, will be called by the internal Transform\nclass methods only.\n\nIn some cases, your transform operation may need to emit a bit more\ndata at the end of the stream. For example, a `Zlib` compression\nstream will store up some internal state so that it can optimally\ncompress the output. At the end, however, it needs to do the best it\ncan with what is left, so that the data will be complete.\n\nIn those cases, you can implement a `_flush` method, which will be\ncalled at the very end, after all the written data is consumed, but\nbefore emitting `end` to signal the end of the readable side. Just\nlike with `_transform`, call `transform.push(chunk)` zero or more\ntimes, as appropriate, and call `callback` when the flush operation is\ncomplete.\n\nThis method is prefixed with an underscore because it is internal to\nthe class that defines it, and should not be called directly by user\nprograms. However, you **are** expected to override this method in\nyour own extension classes.\n\n### Example: `SimpleProtocol` parser\n\nThe example above of a simple protocol parser can be implemented much\nmore simply by using the higher level `Transform` stream class.\n\nIn this example, rather than providing the input as an argument, it\nwould be piped into the parser, which is a more idiomatic Node stream\napproach.\n\n```javascript\nfunction SimpleProtocol(options) {\n if (!(this instanceof SimpleProtocol))\n return new SimpleProtocol(options);\n\n Transform.call(this, options);\n this._inBody = false;\n this._sawFirstCr = false;\n this._rawHeader = [];\n this.header = null;\n}\n\nSimpleProtocol.prototype = Object.create(\n Transform.prototype, { constructor: { value: SimpleProtocol }});\n\nSimpleProtocol.prototype._transform = function(chunk, encoding, done) {\n if (!this._inBody) {\n // check if the chunk has a \\n\\n\n var split = -1;\n for (var i = 0; i < chunk.length; i++) {\n if (chunk[i] === 10) { // '\\n'\n if (this._sawFirstCr) {\n split = i;\n break;\n } else {\n this._sawFirstCr = true;\n }\n } else {\n this._sawFirstCr = false;\n }\n }\n\n if (split === -1) {\n // still waiting for the \\n\\n\n // stash the chunk, and try again.\n this._rawHeader.push(chunk);\n } else {\n this._inBody = true;\n var h = chunk.slice(0, split);\n this._rawHeader.push(h);\n var header = Buffer.concat(this._rawHeader).toString();\n try {\n this.header = JSON.parse(header);\n } catch (er) {\n this.emit('error', new Error('invalid simple protocol data'));\n return;\n }\n // and let them know that we are done parsing the header.\n this.emit('header', this.header);\n\n // now, because we got some extra data, emit this first.\n this.push(b);\n }\n } else {\n // from there on, just provide the data to our consumer as-is.\n this.push(b);\n }\n done();\n};\n\nvar parser = new SimpleProtocol();\nsource.pipe(parser)\n\n// Now parser is a readable stream that will emit 'header'\n// with the parsed header data.\n```\n\n\n## Class: stream.PassThrough\n\nThis is a trivial implementation of a `Transform` stream that simply\npasses the input bytes across to the output. Its purpose is mainly\nfor examples and testing, but there are occasionally use cases where\nit can come in handy.\n\n\n[EventEmitter]: events.html#events_class_events_eventemitter\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/isaacs/readable-stream/issues"
+ },
+ "_id": "readable-stream@1.0.2",
+ "_from": "readable-stream@1.0"
+}
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/sha/node_modules/readable-stream/passthrough.js
new file mode 100644
index 000000000..27e8d8a55
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/passthrough.js
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_passthrough.js")
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/readable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/readable.js
new file mode 100644
index 000000000..4d1ddfc73
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/readable.js
@@ -0,0 +1,6 @@
+exports = module.exports = require('./lib/_stream_readable.js');
+exports.Readable = exports;
+exports.Writable = require('./lib/_stream_writable.js');
+exports.Duplex = require('./lib/_stream_duplex.js');
+exports.Transform = require('./lib/_stream_transform.js');
+exports.PassThrough = require('./lib/_stream_passthrough.js');
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/common.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/common.js
new file mode 100644
index 000000000..1dec2e357
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/common.js
@@ -0,0 +1,191 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+var path = require('path');
+var assert = require('assert');
+
+exports.testDir = path.dirname(__filename);
+exports.fixturesDir = path.join(exports.testDir, 'fixtures');
+exports.libDir = path.join(exports.testDir, '../lib');
+exports.tmpDir = path.join(exports.testDir, 'tmp');
+exports.PORT = 12346;
+
+if (process.platform === 'win32') {
+ exports.PIPE = '\\\\.\\pipe\\libuv-test';
+} else {
+ exports.PIPE = exports.tmpDir + '/test.sock';
+}
+
+var util = require('util');
+for (var i in util) exports[i] = util[i];
+//for (var i in exports) global[i] = exports[i];
+
+function protoCtrChain(o) {
+ var result = [];
+ for (; o; o = o.__proto__) { result.push(o.constructor); }
+ return result.join();
+}
+
+exports.indirectInstanceOf = function(obj, cls) {
+ if (obj instanceof cls) { return true; }
+ var clsChain = protoCtrChain(cls.prototype);
+ var objChain = protoCtrChain(obj);
+ return objChain.slice(-clsChain.length) === clsChain;
+};
+
+
+exports.ddCommand = function(filename, kilobytes) {
+ if (process.platform === 'win32') {
+ var p = path.resolve(exports.fixturesDir, 'create-file.js');
+ return '"' + process.argv[0] + '" "' + p + '" "' +
+ filename + '" ' + (kilobytes * 1024);
+ } else {
+ return 'dd if=/dev/zero of="' + filename + '" bs=1024 count=' + kilobytes;
+ }
+};
+
+
+exports.spawnPwd = function(options) {
+ var spawn = require('child_process').spawn;
+
+ if (process.platform === 'win32') {
+ return spawn('cmd.exe', ['/c', 'cd'], options);
+ } else {
+ return spawn('pwd', [], options);
+ }
+};
+
+
+// Turn this off if the test should not check for global leaks.
+exports.globalCheck = true;
+
+process.on('exit', function() {
+ if (!exports.globalCheck) return;
+ var knownGlobals = [setTimeout,
+ setInterval,
+ global.setImmediate,
+ clearTimeout,
+ clearInterval,
+ global.clearImmediate,
+ console,
+ Buffer,
+ process,
+ global];
+
+ if (global.errno) {
+ knownGlobals.push(errno);
+ }
+
+ if (global.gc) {
+ knownGlobals.push(gc);
+ }
+
+ if (global.DTRACE_HTTP_SERVER_RESPONSE) {
+ knownGlobals.push(DTRACE_HTTP_SERVER_RESPONSE);
+ knownGlobals.push(DTRACE_HTTP_SERVER_REQUEST);
+ knownGlobals.push(DTRACE_HTTP_CLIENT_RESPONSE);
+ knownGlobals.push(DTRACE_HTTP_CLIENT_REQUEST);
+ knownGlobals.push(DTRACE_NET_STREAM_END);
+ knownGlobals.push(DTRACE_NET_SERVER_CONNECTION);
+ knownGlobals.push(DTRACE_NET_SOCKET_READ);
+ knownGlobals.push(DTRACE_NET_SOCKET_WRITE);
+ }
+ if (global.COUNTER_NET_SERVER_CONNECTION) {
+ knownGlobals.push(COUNTER_NET_SERVER_CONNECTION);
+ knownGlobals.push(COUNTER_NET_SERVER_CONNECTION_CLOSE);
+ knownGlobals.push(COUNTER_HTTP_SERVER_REQUEST);
+ knownGlobals.push(COUNTER_HTTP_SERVER_RESPONSE);
+ knownGlobals.push(COUNTER_HTTP_CLIENT_REQUEST);
+ knownGlobals.push(COUNTER_HTTP_CLIENT_RESPONSE);
+ }
+
+ if (global.ArrayBuffer) {
+ knownGlobals.push(ArrayBuffer);
+ knownGlobals.push(Int8Array);
+ knownGlobals.push(Uint8Array);
+ knownGlobals.push(Uint8ClampedArray);
+ knownGlobals.push(Int16Array);
+ knownGlobals.push(Uint16Array);
+ knownGlobals.push(Int32Array);
+ knownGlobals.push(Uint32Array);
+ knownGlobals.push(Float32Array);
+ knownGlobals.push(Float64Array);
+ knownGlobals.push(DataView);
+ }
+
+ for (var x in global) {
+ var found = false;
+
+ for (var y in knownGlobals) {
+ if (global[x] === knownGlobals[y]) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ console.error('Unknown global: %s', x);
+ assert.ok(false, 'Unknown global found');
+ }
+ }
+});
+
+
+var mustCallChecks = [];
+
+
+function runCallChecks() {
+ var failed = mustCallChecks.filter(function(context) {
+ return context.actual !== context.expected;
+ });
+
+ failed.forEach(function(context) {
+ console.log('Mismatched %s function calls. Expected %d, actual %d.',
+ context.name,
+ context.expected,
+ context.actual);
+ console.log(context.stack.split('\n').slice(2).join('\n'));
+ });
+
+ if (failed.length) process.exit(1);
+}
+
+
+exports.mustCall = function(fn, expected) {
+ if (typeof expected !== 'number') expected = 1;
+
+ var context = {
+ expected: expected,
+ actual: 0,
+ stack: (new Error).stack,
+ name: fn.name || '<anonymous>'
+ };
+
+ // add the exit listener only once to avoid listener leak warnings
+ if (mustCallChecks.length === 0) process.on('exit', runCallChecks);
+
+ mustCallChecks.push(context);
+
+ return function() {
+ context.actual++;
+ return fn.apply(this, arguments);
+ };
+};
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/fixtures/x1024.txt b/deps/npm/node_modules/sha/node_modules/readable-stream/test/fixtures/x1024.txt
new file mode 100644
index 000000000..c6a9d2f1a
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/fixtures/x1024.txt
@@ -0,0 +1 @@
+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \ No newline at end of file
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-basic.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-basic.js
new file mode 100644
index 000000000..edc3811ed
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-basic.js
@@ -0,0 +1,475 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+
+var common = require('../common.js');
+var R = require('../../lib/_stream_readable');
+var assert = require('assert');
+
+var util = require('util');
+var EE = require('events').EventEmitter;
+
+function TestReader(n) {
+ R.apply(this);
+ this._buffer = new Buffer(n || 100);
+ this._buffer.fill('x');
+ this._pos = 0;
+ this._bufs = 10;
+}
+
+util.inherits(TestReader, R);
+
+TestReader.prototype.read = function(n) {
+ if (n === 0) return null;
+ var max = this._buffer.length - this._pos;
+ n = n || max;
+ n = Math.max(n, 0);
+ var toRead = Math.min(n, max);
+ if (toRead === 0) {
+ // simulate the read buffer filling up with some more bytes some time
+ // in the future.
+ setTimeout(function() {
+ this._pos = 0;
+ this._bufs -= 1;
+ if (this._bufs <= 0) {
+ // read them all!
+ if (!this.ended) {
+ this.emit('end');
+ this.ended = true;
+ }
+ } else {
+ this.emit('readable');
+ }
+ }.bind(this), 10);
+ return null;
+ }
+
+ var ret = this._buffer.slice(this._pos, this._pos + toRead);
+ this._pos += toRead;
+ return ret;
+};
+
+/////
+
+function TestWriter() {
+ EE.apply(this);
+ this.received = [];
+ this.flush = false;
+}
+
+util.inherits(TestWriter, EE);
+
+TestWriter.prototype.write = function(c) {
+ this.received.push(c.toString());
+ this.emit('write', c);
+ return true;
+};
+
+TestWriter.prototype.end = function(c) {
+ if (c) this.write(c);
+ this.emit('end', this.received);
+};
+
+////////
+
+// tiny node-tap lookalike.
+var tests = [];
+var count = 0;
+
+function test(name, fn) {
+ count++;
+ tests.push([name, fn]);
+}
+
+function run() {
+ var next = tests.shift();
+ if (!next)
+ return console.error('ok');
+
+ var name = next[0];
+ var fn = next[1];
+ console.log('# %s', name);
+ fn({
+ same: assert.deepEqual,
+ ok: assert,
+ equal: assert.equal,
+ end: function () {
+ count--;
+ run();
+ }
+ });
+}
+
+// ensure all tests have run
+process.on("exit", function () {
+ assert.equal(count, 0);
+});
+
+process.nextTick(run);
+
+
+test('a most basic test', function(t) {
+ var r = new TestReader(20);
+
+ var reads = [];
+ var expect = [ 'x',
+ 'xx',
+ 'xxx',
+ 'xxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxxxxx',
+ 'xxxxxxxxx',
+ 'xxx',
+ 'xxxxxxxxxxxx',
+ 'xxxxxxxx',
+ 'xxxxxxxxxxxxxxx',
+ 'xxxxx',
+ 'xxxxxxxxxxxxxxxxxx',
+ 'xx',
+ 'xxxxxxxxxxxxxxxxxxxx',
+ 'xxxxxxxxxxxxxxxxxxxx',
+ 'xxxxxxxxxxxxxxxxxxxx',
+ 'xxxxxxxxxxxxxxxxxxxx',
+ 'xxxxxxxxxxxxxxxxxxxx' ];
+
+ r.on('end', function() {
+ t.same(reads, expect);
+ t.end();
+ });
+
+ var readSize = 1;
+ function flow() {
+ var res;
+ while (null !== (res = r.read(readSize++))) {
+ reads.push(res.toString());
+ }
+ r.once('readable', flow);
+ }
+
+ flow();
+});
+
+test('pipe', function(t) {
+ var r = new TestReader(5);
+
+ var expect = [ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx' ]
+
+ var w = new TestWriter;
+ var flush = true;
+
+ w.on('end', function(received) {
+ t.same(received, expect);
+ t.end();
+ });
+
+ r.pipe(w);
+});
+
+
+
+[1,2,3,4,5,6,7,8,9].forEach(function(SPLIT) {
+ test('unpipe', function(t) {
+ var r = new TestReader(5);
+
+ // unpipe after 3 writes, then write to another stream instead.
+ var expect = [ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx' ];
+ expect = [ expect.slice(0, SPLIT), expect.slice(SPLIT) ];
+
+ var w = [ new TestWriter(), new TestWriter() ];
+
+ var writes = SPLIT;
+ w[0].on('write', function() {
+ if (--writes === 0) {
+ r.unpipe();
+ t.equal(r._readableState.pipes, null);
+ w[0].end();
+ r.pipe(w[1]);
+ t.equal(r._readableState.pipes, w[1]);
+ }
+ });
+
+ var ended = 0;
+
+ var ended0 = false;
+ var ended1 = false;
+ w[0].on('end', function(results) {
+ t.equal(ended0, false);
+ ended0 = true;
+ ended++;
+ t.same(results, expect[0]);
+ });
+
+ w[1].on('end', function(results) {
+ t.equal(ended1, false);
+ ended1 = true;
+ ended++;
+ t.equal(ended, 2);
+ t.same(results, expect[1]);
+ t.end();
+ });
+
+ r.pipe(w[0]);
+ });
+});
+
+
+// both writers should get the same exact data.
+test('multipipe', function(t) {
+ var r = new TestReader(5);
+ var w = [ new TestWriter, new TestWriter ];
+
+ var expect = [ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx' ];
+
+ var c = 2;
+ w[0].on('end', function(received) {
+ t.same(received, expect, 'first');
+ if (--c === 0) t.end();
+ });
+ w[1].on('end', function(received) {
+ t.same(received, expect, 'second');
+ if (--c === 0) t.end();
+ });
+
+ r.pipe(w[0]);
+ r.pipe(w[1]);
+});
+
+
+[1,2,3,4,5,6,7,8,9].forEach(function(SPLIT) {
+ test('multi-unpipe', function(t) {
+ var r = new TestReader(5);
+
+ // unpipe after 3 writes, then write to another stream instead.
+ var expect = [ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx',
+ 'xxxxx' ];
+ expect = [ expect.slice(0, SPLIT), expect.slice(SPLIT) ];
+
+ var w = [ new TestWriter(), new TestWriter(), new TestWriter() ];
+
+ var writes = SPLIT;
+ w[0].on('write', function() {
+ if (--writes === 0) {
+ r.unpipe();
+ w[0].end();
+ r.pipe(w[1]);
+ }
+ });
+
+ var ended = 0;
+
+ w[0].on('end', function(results) {
+ ended++;
+ t.same(results, expect[0]);
+ });
+
+ w[1].on('end', function(results) {
+ ended++;
+ t.equal(ended, 2);
+ t.same(results, expect[1]);
+ t.end();
+ });
+
+ r.pipe(w[0]);
+ r.pipe(w[2]);
+ });
+});
+
+test('back pressure respected', function (t) {
+ function noop() {}
+
+ var r = new R({ objectMode: true });
+ r._read = noop;
+ var counter = 0;
+ r.push(["one"]);
+ r.push(["two"]);
+ r.push(["three"]);
+ r.push(["four"]);
+ r.push(null);
+
+ var w1 = new R();
+ w1.write = function (chunk) {
+ assert.equal(chunk[0], "one");
+ w1.emit("close");
+ process.nextTick(function () {
+ r.pipe(w2);
+ r.pipe(w3);
+ })
+ };
+ w1.end = noop;
+
+ r.pipe(w1);
+
+ var expected = ["two", "two", "three", "three", "four", "four"];
+
+ var w2 = new R();
+ w2.write = function (chunk) {
+ assert.equal(chunk[0], expected.shift());
+ assert.equal(counter, 0);
+
+ counter++;
+
+ if (chunk[0] === "four") {
+ return true;
+ }
+
+ setTimeout(function () {
+ counter--;
+ w2.emit("drain");
+ }, 10);
+
+ return false;
+ }
+ w2.end = noop;
+
+ var w3 = new R();
+ w3.write = function (chunk) {
+ assert.equal(chunk[0], expected.shift());
+ assert.equal(counter, 1);
+
+ counter++;
+
+ if (chunk[0] === "four") {
+ return true;
+ }
+
+ setTimeout(function () {
+ counter--;
+ w3.emit("drain");
+ }, 50);
+
+ return false;
+ };
+ w3.end = function () {
+ assert.equal(counter, 2);
+ assert.equal(expected.length, 0);
+ t.end();
+ };
+});
+
+test('read(0) for ended streams', function (t) {
+ var r = new R();
+ var written = false;
+ var ended = false;
+ r._read = function (n) {};
+
+ r.push(new Buffer("foo"));
+ r.push(null);
+
+ var v = r.read(0);
+
+ assert.equal(v, null);
+
+ var w = new R();
+
+ w.write = function (buffer) {
+ written = true;
+ assert.equal(ended, false);
+ assert.equal(buffer.toString(), "foo")
+ };
+
+ w.end = function () {
+ ended = true;
+ assert.equal(written, true);
+ t.end();
+ };
+
+ r.pipe(w);
+})
+
+test('sync _read ending', function (t) {
+ var r = new R();
+ var called = false;
+ r._read = function (n) {
+ r.push(null);
+ };
+
+ r.once('end', function () {
+ called = true;
+ })
+
+ r.read();
+
+ process.nextTick(function () {
+ assert.equal(called, true);
+ t.end();
+ })
+});
+
+test('adding readable triggers data flow', function(t) {
+ var r = new R({ highWaterMark: 5 });
+ var onReadable = false;
+ var readCalled = 0;
+
+ r._read = function(n) {
+ if (readCalled++ === 2)
+ r.push(null);
+ else
+ r.push(new Buffer('asdf'));
+ };
+
+ var called = false;
+ r.on('readable', function() {
+ onReadable = true;
+ r.read();
+ });
+
+ r.on('end', function() {
+ t.equal(readCalled, 3);
+ t.ok(onReadable);
+ t.end();
+ });
+});
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-compatibility.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-compatibility.js
new file mode 100644
index 000000000..4de76b577
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-compatibility.js
@@ -0,0 +1,50 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+
+var common = require('../common.js');
+var R = require('../../lib/_stream_readable');
+var assert = require('assert');
+
+var util = require('util');
+var EE = require('events').EventEmitter;
+
+var ondataCalled = 0;
+
+function TestReader() {
+ R.apply(this);
+ this._buffer = new Buffer(100);
+ this._buffer.fill('x');
+
+ this.on('data', function() {
+ ondataCalled++;
+ });
+}
+
+util.inherits(TestReader, R);
+
+TestReader.prototype._read = function(n) {
+ this.push(this._buffer);
+ this._buffer = new Buffer(0);
+};
+
+var reader = new TestReader();
+assert.equal(ondataCalled, 1);
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-finish-pipe.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-finish-pipe.js
new file mode 100644
index 000000000..6a7e41e5b
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-finish-pipe.js
@@ -0,0 +1,41 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+var common = require('../common.js');
+var stream = require('../../readable');
+var Buffer = require('buffer').Buffer;
+
+var r = new stream.Readable();
+r._read = function(size) {
+ r.push(new Buffer(size));
+};
+
+var w = new stream.Writable();
+w._write = function(data, encoding, cb) {
+ cb(null);
+};
+
+r.pipe(w);
+
+// This might sound unrealistic, but it happens in net.js. When
+// `socket.allowHalfOpen === false`, EOF will cause `.destroySoon()` call which
+// ends the writable side of net.Socket.
+w.end();
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-large-read-stall.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-large-read-stall.js
new file mode 100644
index 000000000..6da70e888
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-large-read-stall.js
@@ -0,0 +1,82 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+var common = require('../common.js');
+var assert = require('assert');
+
+// If everything aligns so that you do a read(n) of exactly the
+// remaining buffer, then make sure that 'end' still emits.
+
+var READSIZE = 100;
+var PUSHSIZE = 20;
+var PUSHCOUNT = 1000;
+var HWM = 50;
+
+var Readable = require('../../readable').Readable;
+var r = new Readable({
+ highWaterMark: HWM
+});
+var rs = r._readableState;
+
+r._read = push;
+
+r.on('readable', function() {
+ console.error('>> readable');
+ do {
+ console.error(' > read(%d)', READSIZE);
+ var ret = r.read(READSIZE);
+ console.error(' < %j (%d remain)', ret && ret.length, rs.length);
+ } while (ret && ret.length === READSIZE);
+
+ console.error('<< after read()',
+ ret && ret.length,
+ rs.needReadable,
+ rs.length);
+});
+
+var endEmitted = false;
+r.on('end', function() {
+ endEmitted = true;
+ console.error('end');
+});
+
+var pushes = 0;
+function push() {
+ if (pushes > PUSHCOUNT)
+ return;
+
+ if (pushes++ === PUSHCOUNT) {
+ console.error(' push(EOF)');
+ return r.push(null);
+ }
+
+ console.error(' push #%d', pushes);
+ if (r.push(new Buffer(PUSHSIZE)))
+ setTimeout(push);
+}
+
+// start the flow
+var ret = r.read(0);
+
+process.on('exit', function() {
+ assert.equal(pushes, PUSHCOUNT + 1);
+ assert(endEmitted);
+});
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-objects.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-objects.js
new file mode 100644
index 000000000..cd23539f3
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-objects.js
@@ -0,0 +1,348 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+
+var common = require('../common.js');
+var Readable = require('../../lib/_stream_readable');
+var Writable = require('../../lib/_stream_writable');
+var assert = require('assert');
+
+// tiny node-tap lookalike.
+var tests = [];
+var count = 0;
+
+function test(name, fn) {
+ count++;
+ tests.push([name, fn]);
+}
+
+function run() {
+ var next = tests.shift();
+ if (!next)
+ return console.error('ok');
+
+ var name = next[0];
+ var fn = next[1];
+ console.log('# %s', name);
+ fn({
+ same: assert.deepEqual,
+ equal: assert.equal,
+ end: function() {
+ count--;
+ run();
+ }
+ });
+}
+
+// ensure all tests have run
+process.on('exit', function() {
+ assert.equal(count, 0);
+});
+
+process.nextTick(run);
+
+function toArray(callback) {
+ var stream = new Writable({ objectMode: true });
+ var list = [];
+ stream.write = function(chunk) {
+ list.push(chunk);
+ };
+
+ stream.end = function() {
+ callback(list);
+ };
+
+ return stream;
+}
+
+function fromArray(list) {
+ var r = new Readable({ objectMode: true });
+ r._read = noop;
+ list.forEach(function(chunk) {
+ r.push(chunk);
+ });
+ r.push(null);
+
+ return r;
+}
+
+function noop() {}
+
+test('can read objects from stream', function(t) {
+ var r = fromArray([{ one: '1'}, { two: '2' }]);
+
+ var v1 = r.read();
+ var v2 = r.read();
+ var v3 = r.read();
+
+ assert.deepEqual(v1, { one: '1' });
+ assert.deepEqual(v2, { two: '2' });
+ assert.deepEqual(v3, null);
+
+ t.end();
+});
+
+test('can pipe objects into stream', function(t) {
+ var r = fromArray([{ one: '1'}, { two: '2' }]);
+
+ r.pipe(toArray(function(list) {
+ assert.deepEqual(list, [
+ { one: '1' },
+ { two: '2' }
+ ]);
+
+ t.end();
+ }));
+});
+
+test('read(n) is ignored', function(t) {
+ var r = fromArray([{ one: '1'}, { two: '2' }]);
+
+ var value = r.read(2);
+
+ assert.deepEqual(value, { one: '1' });
+
+ t.end();
+});
+
+test('can read objects from _read (sync)', function(t) {
+ var r = new Readable({ objectMode: true });
+ var list = [{ one: '1'}, { two: '2' }];
+ r._read = function(n) {
+ var item = list.shift();
+ r.push(item || null);
+ };
+
+ r.pipe(toArray(function(list) {
+ assert.deepEqual(list, [
+ { one: '1' },
+ { two: '2' }
+ ]);
+
+ t.end();
+ }));
+});
+
+test('can read objects from _read (async)', function(t) {
+ var r = new Readable({ objectMode: true });
+ var list = [{ one: '1'}, { two: '2' }];
+ r._read = function(n) {
+ var item = list.shift();
+ process.nextTick(function() {
+ r.push(item || null);
+ });
+ };
+
+ r.pipe(toArray(function(list) {
+ assert.deepEqual(list, [
+ { one: '1' },
+ { two: '2' }
+ ]);
+
+ t.end();
+ }));
+});
+
+test('can read strings as objects', function(t) {
+ var r = new Readable({
+ objectMode: true
+ });
+ r._read = noop;
+ var list = ['one', 'two', 'three'];
+ list.forEach(function(str) {
+ r.push(str);
+ });
+ r.push(null);
+
+ r.pipe(toArray(function(array) {
+ assert.deepEqual(array, list);
+
+ t.end();
+ }));
+});
+
+test('read(0) for object streams', function(t) {
+ var r = new Readable({
+ objectMode: true
+ });
+ r._read = noop;
+
+ r.push('foobar');
+ r.push(null);
+
+ var v = r.read(0);
+
+ r.pipe(toArray(function(array) {
+ assert.deepEqual(array, ['foobar']);
+
+ t.end();
+ }));
+});
+
+test('falsey values', function(t) {
+ var r = new Readable({
+ objectMode: true
+ });
+ r._read = noop;
+
+ r.push(false);
+ r.push(0);
+ r.push('');
+ r.push(null);
+
+ r.pipe(toArray(function(array) {
+ assert.deepEqual(array, [false, 0, '']);
+
+ t.end();
+ }));
+});
+
+test('high watermark _read', function(t) {
+ var r = new Readable({
+ highWaterMark: 6,
+ objectMode: true
+ });
+ var calls = 0;
+ var list = ['1', '2', '3', '4', '5', '6', '7', '8'];
+
+ r._read = function(n) {
+ calls++;
+ };
+
+ list.forEach(function(c) {
+ r.push(c);
+ });
+
+ var v = r.read();
+
+ assert.equal(calls, 0);
+ assert.equal(v, '1');
+
+ var v2 = r.read();
+
+ assert.equal(calls, 1);
+ assert.equal(v2, '2');
+
+ t.end();
+});
+
+test('high watermark push', function(t) {
+ var r = new Readable({
+ highWaterMark: 6,
+ objectMode: true
+ });
+ r._read = function(n) {};
+ for (var i = 0; i < 6; i++) {
+ var bool = r.push(i);
+ assert.equal(bool, i === 5 ? false : true);
+ }
+
+ t.end();
+});
+
+test('can write objects to stream', function(t) {
+ var w = new Writable({ objectMode: true });
+
+ w._write = function(chunk, encoding, cb) {
+ assert.deepEqual(chunk, { foo: 'bar' });
+ cb();
+ };
+
+ w.on('finish', function() {
+ t.end();
+ });
+
+ w.write({ foo: 'bar' });
+ w.end();
+});
+
+test('can write multiple objects to stream', function(t) {
+ var w = new Writable({ objectMode: true });
+ var list = [];
+
+ w._write = function(chunk, encoding, cb) {
+ list.push(chunk);
+ cb();
+ };
+
+ w.on('finish', function() {
+ assert.deepEqual(list, [0, 1, 2, 3, 4]);
+
+ t.end();
+ });
+
+ w.write(0);
+ w.write(1);
+ w.write(2);
+ w.write(3);
+ w.write(4);
+ w.end();
+});
+
+test('can write strings as objects', function(t) {
+ var w = new Writable({
+ objectMode: true
+ });
+ var list = [];
+
+ w._write = function(chunk, encoding, cb) {
+ list.push(chunk);
+ process.nextTick(cb);
+ };
+
+ w.on('finish', function() {
+ assert.deepEqual(list, ['0', '1', '2', '3', '4']);
+
+ t.end();
+ });
+
+ w.write('0');
+ w.write('1');
+ w.write('2');
+ w.write('3');
+ w.write('4');
+ w.end();
+});
+
+test('buffers finish until cb is called', function(t) {
+ var w = new Writable({
+ objectMode: true
+ });
+ var called = false;
+
+ w._write = function(chunk, encoding, cb) {
+ assert.equal(chunk, 'foo');
+
+ process.nextTick(function() {
+ called = true;
+ cb();
+ });
+ };
+
+ w.on('finish', function() {
+ assert.equal(called, true);
+
+ t.end();
+ });
+
+ w.write('foo');
+ w.end();
+});
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-pipe-error-handling.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-pipe-error-handling.js
new file mode 100644
index 000000000..823dae2c0
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-pipe-error-handling.js
@@ -0,0 +1,105 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+var common = require('../common');
+var assert = require('assert');
+var stream = require('../../readable');
+
+(function testErrorListenerCatches() {
+ var count = 1000;
+
+ var source = new stream.Readable();
+ source._read = function(n) {
+ n = Math.min(count, n);
+ count -= n;
+ source.push(new Buffer(n));
+ };
+
+ var unpipedDest;
+ source.unpipe = function(dest) {
+ unpipedDest = dest;
+ stream.Readable.prototype.unpipe.call(this, dest);
+ };
+
+ var dest = new stream.Writable();
+ dest._write = function(chunk, encoding, cb) {
+ cb();
+ };
+
+ source.pipe(dest);
+
+ var gotErr = null;
+ dest.on('error', function(err) {
+ gotErr = err;
+ });
+
+ var unpipedSource;
+ dest.on('unpipe', function(src) {
+ unpipedSource = src;
+ });
+
+ var err = new Error('This stream turned into bacon.');
+ dest.emit('error', err);
+ assert.strictEqual(gotErr, err);
+ assert.strictEqual(unpipedSource, source);
+ assert.strictEqual(unpipedDest, dest);
+})();
+
+(function testErrorWithoutListenerThrows() {
+ var count = 1000;
+
+ var source = new stream.Readable();
+ source._read = function(n) {
+ n = Math.min(count, n);
+ count -= n;
+ source.push(new Buffer(n));
+ };
+
+ var unpipedDest;
+ source.unpipe = function(dest) {
+ unpipedDest = dest;
+ stream.Readable.prototype.unpipe.call(this, dest);
+ };
+
+ var dest = new stream.Writable();
+ dest._write = function(chunk, encoding, cb) {
+ cb();
+ };
+
+ source.pipe(dest);
+
+ var unpipedSource;
+ dest.on('unpipe', function(src) {
+ unpipedSource = src;
+ });
+
+ var err = new Error('This stream turned into bacon.');
+
+ var gotErr = null;
+ try {
+ dest.emit('error', err);
+ } catch (e) {
+ gotErr = e;
+ }
+ assert.strictEqual(gotErr, err);
+ assert.strictEqual(unpipedSource, source);
+ assert.strictEqual(unpipedDest, dest);
+})();
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-push.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-push.js
new file mode 100644
index 000000000..e85f785d9
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-push.js
@@ -0,0 +1,138 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+var common = require('../common.js');
+var stream = require('../../readable');
+var Readable = stream.Readable;
+var Writable = stream.Writable;
+var assert = require('assert');
+
+var util = require('util');
+var EE = require('events').EventEmitter;
+
+
+// a mock thing a bit like the net.Socket/tcp_wrap.handle interaction
+
+var stream = new Readable({
+ highWaterMark: 16,
+ encoding: 'utf8'
+});
+
+var source = new EE;
+
+stream._read = function() {
+ console.error('stream._read');
+ readStart();
+};
+
+var ended = false;
+stream.on('end', function() {
+ ended = true;
+});
+
+source.on('data', function(chunk) {
+ var ret = stream.push(chunk);
+ console.error('data', stream._readableState.length);
+ if (!ret)
+ readStop();
+});
+
+source.on('end', function() {
+ stream.push(null);
+});
+
+var reading = false;
+
+function readStart() {
+ console.error('readStart');
+ reading = true;
+}
+
+function readStop() {
+ console.error('readStop');
+ reading = false;
+ process.nextTick(function() {
+ var r = stream.read();
+ if (r !== null)
+ writer.write(r);
+ });
+}
+
+var writer = new Writable({
+ decodeStrings: false
+});
+
+var written = [];
+
+var expectWritten =
+ [ 'asdfgasdfgasdfgasdfg',
+ 'asdfgasdfgasdfgasdfg',
+ 'asdfgasdfgasdfgasdfg',
+ 'asdfgasdfgasdfgasdfg',
+ 'asdfgasdfgasdfgasdfg',
+ 'asdfgasdfgasdfgasdfg' ];
+
+writer._write = function(chunk, encoding, cb) {
+ console.error('WRITE %s', chunk);
+ written.push(chunk);
+ process.nextTick(cb);
+};
+
+writer.on('finish', finish);
+
+
+// now emit some chunks.
+
+var chunk = "asdfg";
+
+var set = 0;
+readStart();
+data();
+function data() {
+ assert(reading);
+ source.emit('data', chunk);
+ assert(reading);
+ source.emit('data', chunk);
+ assert(reading);
+ source.emit('data', chunk);
+ assert(reading);
+ source.emit('data', chunk);
+ assert(!reading);
+ if (set++ < 5)
+ setTimeout(data, 10);
+ else
+ end();
+}
+
+function finish() {
+ console.error('finish');
+ assert.deepEqual(written, expectWritten);
+ console.log('ok');
+}
+
+function end() {
+ source.emit('end');
+ assert(!reading);
+ writer.end(stream.read());
+ setTimeout(function() {
+ assert(ended);
+ });
+}
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-read-sync-stack.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-read-sync-stack.js
new file mode 100644
index 000000000..7e86eec53
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-read-sync-stack.js
@@ -0,0 +1,54 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+var common = require('../common');
+var assert = require('assert');
+var Readable = require('../../readable').Readable;
+var r = new Readable();
+var N = 256 * 1024;
+
+// Go ahead and allow the pathological case for this test.
+// Yes, it's an infinite loop, that's the point.
+process.maxTickDepth = N + 2;
+
+var reads = 0;
+r._read = function(n) {
+ var chunk = reads++ === N ? null : new Buffer(1);
+ r.push(chunk);
+};
+
+r.on('readable', function onReadable() {
+ if (!(r._readableState.length % 256))
+ console.error('readable', r._readableState.length);
+ r.read(N * 2);
+});
+
+var ended = false;
+r.on('end', function onEnd() {
+ ended = true;
+});
+
+r.read(0);
+
+process.on('exit', function() {
+ assert(ended);
+ console.log('ok');
+});
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-empty-buffer-no-eof.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-empty-buffer-no-eof.js
new file mode 100644
index 000000000..1b067f53b
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-empty-buffer-no-eof.js
@@ -0,0 +1,119 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+var common = require('../common');
+var assert = require('assert');
+
+var Readable = require('../../readable').Readable;
+
+test1();
+if (!/^v0\.[0-8]\./.test(process.version))
+ test2();
+
+function test1() {
+ var r = new Readable();
+
+ // should not end when we get a Buffer(0) or '' as the _read result
+ // that just means that there is *temporarily* no data, but to go
+ // ahead and try again later.
+ //
+ // note that this is very unusual. it only works for crypto streams
+ // because the other side of the stream will call read(0) to cycle
+ // data through openssl. that's why we set the timeouts to call
+ // r.read(0) again later, otherwise there is no more work being done
+ // and the process just exits.
+
+ var buf = new Buffer(5);
+ buf.fill('x');
+ var reads = 5;
+ r._read = function(n) {
+ switch (reads--) {
+ case 0:
+ return r.push(null); // EOF
+ case 1:
+ return r.push(buf);
+ case 2:
+ setTimeout(r.read.bind(r, 0), 10);
+ return r.push(new Buffer(0)); // Not-EOF!
+ case 3:
+ setTimeout(r.read.bind(r, 0), 10);
+ return process.nextTick(function() {
+ return r.push(new Buffer(0));
+ });
+ case 4:
+ setTimeout(r.read.bind(r, 0), 10);
+ return setTimeout(function() {
+ return r.push(new Buffer(0));
+ });
+ case 5:
+ return setTimeout(function() {
+ return r.push(buf);
+ });
+ default:
+ throw new Error('unreachable');
+ }
+ };
+
+ var results = [];
+ function flow() {
+ var chunk;
+ while (null !== (chunk = r.read()))
+ results.push(chunk + '');
+ }
+ r.on('readable', flow);
+ r.on('end', function() {
+ results.push('EOF');
+ });
+ flow();
+
+ process.on('exit', function() {
+ assert.deepEqual(results, [ 'xxxxx', 'xxxxx', 'EOF' ]);
+ console.log('ok');
+ });
+}
+
+function test2() {
+ var r = new Readable({ encoding: 'base64' });
+ var reads = 5;
+ r._read = function(n) {
+ if (!reads--)
+ return r.push(null); // EOF
+ else
+ return r.push(new Buffer('x'));
+ };
+
+ var results = [];
+ function flow() {
+ var chunk;
+ while (null !== (chunk = r.read()))
+ results.push(chunk + '');
+ }
+ r.on('readable', flow);
+ r.on('end', function() {
+ results.push('EOF');
+ });
+ flow();
+
+ process.on('exit', function() {
+ assert.deepEqual(results, [ 'eHh4', 'eHg=', 'EOF' ]);
+ console.log('ok');
+ });
+}
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-from-list.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-from-list.js
new file mode 100644
index 000000000..04a96f537
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-from-list.js
@@ -0,0 +1,120 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+var assert = require('assert');
+var common = require('../common.js');
+var fromList = require('../../lib/_stream_readable')._fromList;
+
+// tiny node-tap lookalike.
+var tests = [];
+var count = 0;
+
+function test(name, fn) {
+ count++;
+ tests.push([name, fn]);
+}
+
+function run() {
+ var next = tests.shift();
+ if (!next)
+ return console.error('ok');
+
+ var name = next[0];
+ var fn = next[1];
+ console.log('# %s', name);
+ fn({
+ same: assert.deepEqual,
+ equal: assert.equal,
+ end: function () {
+ count--;
+ run();
+ }
+ });
+}
+
+// ensure all tests have run
+process.on("exit", function () {
+ assert.equal(count, 0);
+});
+
+process.nextTick(run);
+
+
+
+test('buffers', function(t) {
+ // have a length
+ var len = 16;
+ var list = [ new Buffer('foog'),
+ new Buffer('bark'),
+ new Buffer('bazy'),
+ new Buffer('kuel') ];
+
+ // read more than the first element.
+ var ret = fromList(6, { buffer: list, length: 16 });
+ t.equal(ret.toString(), 'foogba');
+
+ // read exactly the first element.
+ ret = fromList(2, { buffer: list, length: 10 });
+ t.equal(ret.toString(), 'rk');
+
+ // read less than the first element.
+ ret = fromList(2, { buffer: list, length: 8 });
+ t.equal(ret.toString(), 'ba');
+
+ // read more than we have.
+ ret = fromList(100, { buffer: list, length: 6 });
+ t.equal(ret.toString(), 'zykuel');
+
+ // all consumed.
+ t.same(list, []);
+
+ t.end();
+});
+
+test('strings', function(t) {
+ // have a length
+ var len = 16;
+ var list = [ 'foog',
+ 'bark',
+ 'bazy',
+ 'kuel' ];
+
+ // read more than the first element.
+ var ret = fromList(6, { buffer: list, length: 16, decoder: true });
+ t.equal(ret, 'foogba');
+
+ // read exactly the first element.
+ ret = fromList(2, { buffer: list, length: 10, decoder: true });
+ t.equal(ret, 'rk');
+
+ // read less than the first element.
+ ret = fromList(2, { buffer: list, length: 8, decoder: true });
+ t.equal(ret, 'ba');
+
+ // read more than we have.
+ ret = fromList(100, { buffer: list, length: 6, decoder: true });
+ t.equal(ret, 'zykuel');
+
+ // all consumed.
+ t.same(list, []);
+
+ t.end();
+});
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-legacy-drain.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-legacy-drain.js
new file mode 100644
index 000000000..c6cbc7d6b
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-legacy-drain.js
@@ -0,0 +1,75 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+var common = require('../common');
+var assert = require('assert');
+
+var Stream = require('../../readable');
+var Readable = Stream.Readable;
+
+var r = new Readable();
+var N = 256;
+var reads = 0;
+r._read = function(n) {
+ return r.push(++reads === N ? null : new Buffer(1));
+};
+
+var rended = false;
+r.on('end', function() {
+ rended = true;
+});
+
+var w = new Stream();
+w.writable = true;
+var writes = 0;
+var buffered = 0;
+w.write = function(c) {
+ writes += c.length;
+ buffered += c.length;
+ process.nextTick(drain);
+ return false;
+};
+
+function drain() {
+ assert(buffered <= 2);
+ buffered = 0;
+ w.emit('drain');
+}
+
+
+var wended = false;
+w.end = function() {
+ wended = true;
+};
+
+// Just for kicks, let's mess with the drain count.
+// This verifies that even if it gets negative in the
+// pipe() cleanup function, we'll still function properly.
+r.on('readable', function() {
+ w.emit('drain');
+});
+
+r.pipe(w);
+process.on('exit', function() {
+ assert(rended);
+ assert(wended);
+ console.error('ok');
+});
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-non-empty-end.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-non-empty-end.js
new file mode 100644
index 000000000..c971898c1
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-readable-non-empty-end.js
@@ -0,0 +1,78 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+var assert = require('assert');
+var common = require('../common.js');
+var Readable = require('../../lib/_stream_readable');
+
+var len = 0;
+var chunks = new Array(10);
+for (var i = 1; i <= 10; i++) {
+ chunks[i-1] = new Buffer(i);
+ len += i;
+}
+
+var test = new Readable();
+var n = 0;
+test._read = function(size) {
+ var chunk = chunks[n++];
+ setTimeout(function() {
+ test.push(chunk);
+ });
+};
+
+test.on('end', thrower);
+function thrower() {
+ throw new Error('this should not happen!');
+}
+
+var bytesread = 0;
+test.on('readable', function() {
+ var b = len - bytesread - 1;
+ var res = test.read(b);
+ if (res) {
+ bytesread += res.length;
+ console.error('br=%d len=%d', bytesread, len);
+ setTimeout(next);
+ }
+ test.read(0);
+});
+test.read(0);
+
+function next() {
+ // now let's make 'end' happen
+ test.removeListener('end', thrower);
+
+ var endEmitted = false;
+ process.on('exit', function() {
+ assert(endEmitted, 'end should be emitted by now');
+ });
+ test.on('end', function() {
+ endEmitted = true;
+ });
+
+ // one to get the last byte
+ var r = test.read();
+ assert(r);
+ assert.equal(r.length, 1);
+ r = test.read();
+ assert.equal(r, null);
+}
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-set-encoding.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-set-encoding.js
new file mode 100644
index 000000000..602acd6d4
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-set-encoding.js
@@ -0,0 +1,312 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+
+var common = require('../common.js');
+var assert = require('assert');
+var R = require('../../lib/_stream_readable');
+var util = require('util');
+
+// tiny node-tap lookalike.
+var tests = [];
+var count = 0;
+
+function test(name, fn) {
+ count++;
+ tests.push([name, fn]);
+}
+
+function run() {
+ var next = tests.shift();
+ if (!next)
+ return console.error('ok');
+
+ var name = next[0];
+ var fn = next[1];
+ console.log('# %s', name);
+ fn({
+ same: assert.deepEqual,
+ equal: assert.equal,
+ end: function () {
+ count--;
+ run();
+ }
+ });
+}
+
+// ensure all tests have run
+process.on("exit", function () {
+ assert.equal(count, 0);
+});
+
+process.nextTick(run);
+
+/////
+
+util.inherits(TestReader, R);
+
+function TestReader(n, opts) {
+ R.call(this, opts);
+
+ this.pos = 0;
+ this.len = n || 100;
+}
+
+TestReader.prototype._read = function(n) {
+ setTimeout(function() {
+
+ if (this.pos >= this.len) {
+ return this.push(null);
+ }
+
+ n = Math.min(n, this.len - this.pos);
+ if (n <= 0) {
+ return this.push(null);
+ }
+
+ this.pos += n;
+ var ret = new Buffer(n);
+ ret.fill('a');
+
+ console.log("this.push(ret)", ret)
+
+ return this.push(ret);
+ }.bind(this), 1);
+};
+
+test('setEncoding utf8', function(t) {
+ var tr = new TestReader(100);
+ tr.setEncoding('utf8');
+ var out = [];
+ var expect =
+ [ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa' ];
+
+ tr.on('readable', function flow() {
+ var chunk;
+ while (null !== (chunk = tr.read(10)))
+ out.push(chunk);
+ });
+
+ tr.on('end', function() {
+ t.same(out, expect);
+ t.end();
+ });
+
+ // just kick it off.
+ tr.emit('readable');
+});
+
+
+test('setEncoding hex', function(t) {
+ var tr = new TestReader(100);
+ tr.setEncoding('hex');
+ var out = [];
+ var expect =
+ [ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161' ];
+
+ tr.on('readable', function flow() {
+ var chunk;
+ while (null !== (chunk = tr.read(10)))
+ out.push(chunk);
+ });
+
+ tr.on('end', function() {
+ t.same(out, expect);
+ t.end();
+ });
+
+ // just kick it off.
+ tr.emit('readable');
+});
+
+test('setEncoding hex with read(13)', function(t) {
+ var tr = new TestReader(100);
+ tr.setEncoding('hex');
+ var out = [];
+ var expect =
+ [ "6161616161616",
+ "1616161616161",
+ "6161616161616",
+ "1616161616161",
+ "6161616161616",
+ "1616161616161",
+ "6161616161616",
+ "1616161616161",
+ "6161616161616",
+ "1616161616161",
+ "6161616161616",
+ "1616161616161",
+ "6161616161616",
+ "1616161616161",
+ "6161616161616",
+ "16161" ];
+
+ tr.on('readable', function flow() {
+ console.log("readable once")
+ var chunk;
+ while (null !== (chunk = tr.read(13)))
+ out.push(chunk);
+ });
+
+ tr.on('end', function() {
+ console.log("END")
+ t.same(out, expect);
+ t.end();
+ });
+
+ // just kick it off.
+ tr.emit('readable');
+});
+
+test('encoding: utf8', function(t) {
+ var tr = new TestReader(100, { encoding: 'utf8' });
+ var out = [];
+ var expect =
+ [ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa',
+ 'aaaaaaaaaa' ];
+
+ tr.on('readable', function flow() {
+ var chunk;
+ while (null !== (chunk = tr.read(10)))
+ out.push(chunk);
+ });
+
+ tr.on('end', function() {
+ t.same(out, expect);
+ t.end();
+ });
+
+ // just kick it off.
+ tr.emit('readable');
+});
+
+
+test('encoding: hex', function(t) {
+ var tr = new TestReader(100, { encoding: 'hex' });
+ var out = [];
+ var expect =
+ [ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161',
+ '6161616161' ];
+
+ tr.on('readable', function flow() {
+ var chunk;
+ while (null !== (chunk = tr.read(10)))
+ out.push(chunk);
+ });
+
+ tr.on('end', function() {
+ t.same(out, expect);
+ t.end();
+ });
+
+ // just kick it off.
+ tr.emit('readable');
+});
+
+test('encoding: hex with read(13)', function(t) {
+ var tr = new TestReader(100, { encoding: 'hex' });
+ var out = [];
+ var expect =
+ [ "6161616161616",
+ "1616161616161",
+ "6161616161616",
+ "1616161616161",
+ "6161616161616",
+ "1616161616161",
+ "6161616161616",
+ "1616161616161",
+ "6161616161616",
+ "1616161616161",
+ "6161616161616",
+ "1616161616161",
+ "6161616161616",
+ "1616161616161",
+ "6161616161616",
+ "16161" ];
+
+ tr.on('readable', function flow() {
+ var chunk;
+ while (null !== (chunk = tr.read(13)))
+ out.push(chunk);
+ });
+
+ tr.on('end', function() {
+ t.same(out, expect);
+ t.end();
+ });
+
+ // just kick it off.
+ tr.emit('readable');
+});
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-transform.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-transform.js
new file mode 100644
index 000000000..5804c39d8
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-transform.js
@@ -0,0 +1,435 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+var assert = require('assert');
+var common = require('../common.js');
+var PassThrough = require('../../lib/_stream_passthrough');
+var Transform = require('../../lib/_stream_transform');
+
+// tiny node-tap lookalike.
+var tests = [];
+var count = 0;
+
+function test(name, fn) {
+ count++;
+ tests.push([name, fn]);
+}
+
+function run() {
+ var next = tests.shift();
+ if (!next)
+ return console.error('ok');
+
+ var name = next[0];
+ var fn = next[1];
+ console.log('# %s', name);
+ fn({
+ same: assert.deepEqual,
+ equal: assert.equal,
+ ok: assert,
+ end: function () {
+ count--;
+ run();
+ }
+ });
+}
+
+// ensure all tests have run
+process.on("exit", function () {
+ assert.equal(count, 0);
+});
+
+process.nextTick(run);
+
+/////
+
+test('writable side consumption', function(t) {
+ var tx = new Transform({
+ highWaterMark: 10
+ });
+
+ var transformed = 0;
+ tx._transform = function(chunk, encoding, cb) {
+ transformed += chunk.length;
+ tx.push(chunk);
+ cb();
+ };
+
+ for (var i = 1; i <= 10; i++) {
+ tx.write(new Buffer(i));
+ }
+ tx.end();
+
+ t.equal(tx._readableState.length, 10);
+ t.equal(transformed, 10);
+ t.equal(tx._transformState.writechunk.length, 5);
+ t.same(tx._writableState.buffer.map(function(c) {
+ return c.chunk.length;
+ }), [6, 7, 8, 9, 10]);
+
+ t.end();
+});
+
+test('passthrough', function(t) {
+ var pt = new PassThrough();
+
+ pt.write(new Buffer('foog'));
+ pt.write(new Buffer('bark'));
+ pt.write(new Buffer('bazy'));
+ pt.write(new Buffer('kuel'));
+ pt.end();
+
+ t.equal(pt.read(5).toString(), 'foogb');
+ t.equal(pt.read(5).toString(), 'arkba');
+ t.equal(pt.read(5).toString(), 'zykue');
+ t.equal(pt.read(5).toString(), 'l');
+ t.end();
+});
+
+test('simple transform', function(t) {
+ var pt = new Transform;
+ pt._transform = function(c, e, cb) {
+ var ret = new Buffer(c.length);
+ ret.fill('x');
+ pt.push(ret);
+ cb();
+ };
+
+ pt.write(new Buffer('foog'));
+ pt.write(new Buffer('bark'));
+ pt.write(new Buffer('bazy'));
+ pt.write(new Buffer('kuel'));
+ pt.end();
+
+ t.equal(pt.read(5).toString(), 'xxxxx');
+ t.equal(pt.read(5).toString(), 'xxxxx');
+ t.equal(pt.read(5).toString(), 'xxxxx');
+ t.equal(pt.read(5).toString(), 'x');
+ t.end();
+});
+
+test('async passthrough', function(t) {
+ var pt = new Transform;
+ pt._transform = function(chunk, encoding, cb) {
+ setTimeout(function() {
+ pt.push(chunk);
+ cb();
+ }, 10);
+ };
+
+ pt.write(new Buffer('foog'));
+ pt.write(new Buffer('bark'));
+ pt.write(new Buffer('bazy'));
+ pt.write(new Buffer('kuel'));
+ pt.end();
+
+ pt.on('finish', function() {
+ t.equal(pt.read(5).toString(), 'foogb');
+ t.equal(pt.read(5).toString(), 'arkba');
+ t.equal(pt.read(5).toString(), 'zykue');
+ t.equal(pt.read(5).toString(), 'l');
+ t.end();
+ });
+});
+
+test('assymetric transform (expand)', function(t) {
+ var pt = new Transform;
+
+ // emit each chunk 2 times.
+ pt._transform = function(chunk, encoding, cb) {
+ setTimeout(function() {
+ pt.push(chunk);
+ setTimeout(function() {
+ pt.push(chunk);
+ cb();
+ }, 10)
+ }, 10);
+ };
+
+ pt.write(new Buffer('foog'));
+ pt.write(new Buffer('bark'));
+ pt.write(new Buffer('bazy'));
+ pt.write(new Buffer('kuel'));
+ pt.end();
+
+ pt.on('finish', function() {
+ t.equal(pt.read(5).toString(), 'foogf');
+ t.equal(pt.read(5).toString(), 'oogba');
+ t.equal(pt.read(5).toString(), 'rkbar');
+ t.equal(pt.read(5).toString(), 'kbazy');
+ t.equal(pt.read(5).toString(), 'bazyk');
+ t.equal(pt.read(5).toString(), 'uelku');
+ t.equal(pt.read(5).toString(), 'el');
+ t.end();
+ });
+});
+
+test('assymetric transform (compress)', function(t) {
+ var pt = new Transform;
+
+ // each output is the first char of 3 consecutive chunks,
+ // or whatever's left.
+ pt.state = '';
+
+ pt._transform = function(chunk, encoding, cb) {
+ if (!chunk)
+ chunk = '';
+ var s = chunk.toString();
+ setTimeout(function() {
+ this.state += s.charAt(0);
+ if (this.state.length === 3) {
+ pt.push(new Buffer(this.state));
+ this.state = '';
+ }
+ cb();
+ }.bind(this), 10);
+ };
+
+ pt._flush = function(cb) {
+ // just output whatever we have.
+ pt.push(new Buffer(this.state));
+ this.state = '';
+ cb();
+ };
+
+ pt.write(new Buffer('aaaa'));
+ pt.write(new Buffer('bbbb'));
+ pt.write(new Buffer('cccc'));
+ pt.write(new Buffer('dddd'));
+ pt.write(new Buffer('eeee'));
+ pt.write(new Buffer('aaaa'));
+ pt.write(new Buffer('bbbb'));
+ pt.write(new Buffer('cccc'));
+ pt.write(new Buffer('dddd'));
+ pt.write(new Buffer('eeee'));
+ pt.write(new Buffer('aaaa'));
+ pt.write(new Buffer('bbbb'));
+ pt.write(new Buffer('cccc'));
+ pt.write(new Buffer('dddd'));
+ pt.end();
+
+ // 'abcdeabcdeabcd'
+ pt.on('finish', function() {
+ t.equal(pt.read(5).toString(), 'abcde');
+ t.equal(pt.read(5).toString(), 'abcde');
+ t.equal(pt.read(5).toString(), 'abcd');
+ t.end();
+ });
+});
+
+
+test('passthrough event emission', function(t) {
+ var pt = new PassThrough();
+ var emits = 0;
+ pt.on('readable', function() {
+ var state = pt._readableState;
+ console.error('>>> emit readable %d', emits);
+ emits++;
+ });
+
+ var i = 0;
+
+ pt.write(new Buffer('foog'));
+
+ console.error('need emit 0');
+ pt.write(new Buffer('bark'));
+
+ console.error('should have emitted readable now 1 === %d', emits);
+ t.equal(emits, 1);
+
+ t.equal(pt.read(5).toString(), 'foogb');
+ t.equal(pt.read(5) + '', 'null');
+
+ console.error('need emit 1');
+
+ pt.write(new Buffer('bazy'));
+ console.error('should have emitted, but not again');
+ pt.write(new Buffer('kuel'));
+
+ console.error('should have emitted readable now 2 === %d', emits);
+ t.equal(emits, 2);
+
+ t.equal(pt.read(5).toString(), 'arkba');
+ t.equal(pt.read(5).toString(), 'zykue');
+ t.equal(pt.read(5), null);
+
+ console.error('need emit 2');
+
+ pt.end();
+
+ t.equal(emits, 3);
+
+ t.equal(pt.read(5).toString(), 'l');
+ t.equal(pt.read(5), null);
+
+ console.error('should not have emitted again');
+ t.equal(emits, 3);
+ t.end();
+});
+
+test('passthrough event emission reordered', function(t) {
+ var pt = new PassThrough;
+ var emits = 0;
+ pt.on('readable', function() {
+ console.error('emit readable', emits)
+ emits++;
+ });
+
+ pt.write(new Buffer('foog'));
+ console.error('need emit 0');
+ pt.write(new Buffer('bark'));
+ console.error('should have emitted readable now 1 === %d', emits);
+ t.equal(emits, 1);
+
+ t.equal(pt.read(5).toString(), 'foogb');
+ t.equal(pt.read(5), null);
+
+ console.error('need emit 1');
+ pt.once('readable', function() {
+ t.equal(pt.read(5).toString(), 'arkba');
+
+ t.equal(pt.read(5), null);
+
+ console.error('need emit 2');
+ pt.once('readable', function() {
+ t.equal(pt.read(5).toString(), 'zykue');
+ t.equal(pt.read(5), null);
+ pt.once('readable', function() {
+ t.equal(pt.read(5).toString(), 'l');
+ t.equal(pt.read(5), null);
+ t.equal(emits, 4);
+ t.end();
+ });
+ pt.end();
+ });
+ pt.write(new Buffer('kuel'));
+ });
+
+ pt.write(new Buffer('bazy'));
+});
+
+test('passthrough facaded', function(t) {
+ console.error('passthrough facaded');
+ var pt = new PassThrough;
+ var datas = [];
+ pt.on('data', function(chunk) {
+ datas.push(chunk.toString());
+ });
+
+ pt.on('end', function() {
+ t.same(datas, ['foog', 'bark', 'bazy', 'kuel']);
+ t.end();
+ });
+
+ pt.write(new Buffer('foog'));
+ setTimeout(function() {
+ pt.write(new Buffer('bark'));
+ setTimeout(function() {
+ pt.write(new Buffer('bazy'));
+ setTimeout(function() {
+ pt.write(new Buffer('kuel'));
+ setTimeout(function() {
+ pt.end();
+ }, 10);
+ }, 10);
+ }, 10);
+ }, 10);
+});
+
+test('object transform (json parse)', function(t) {
+ console.error('json parse stream');
+ var jp = new Transform({ objectMode: true });
+ jp._transform = function(data, encoding, cb) {
+ try {
+ jp.push(JSON.parse(data));
+ cb();
+ } catch (er) {
+ cb(er);
+ }
+ };
+
+ // anything except null/undefined is fine.
+ // those are "magic" in the stream API, because they signal EOF.
+ var objects = [
+ { foo: 'bar' },
+ 100,
+ "string",
+ { nested: { things: [ { foo: 'bar' }, 100, "string" ] } }
+ ];
+
+ var ended = false;
+ jp.on('end', function() {
+ ended = true;
+ });
+
+ objects.forEach(function(obj) {
+ jp.write(JSON.stringify(obj));
+ var res = jp.read();
+ t.same(res, obj);
+ });
+
+ jp.end();
+
+ process.nextTick(function() {
+ t.ok(ended);
+ t.end();
+ })
+});
+
+test('object transform (json stringify)', function(t) {
+ console.error('json parse stream');
+ var js = new Transform({ objectMode: true });
+ js._transform = function(data, encoding, cb) {
+ try {
+ js.push(JSON.stringify(data));
+ cb();
+ } catch (er) {
+ cb(er);
+ }
+ };
+
+ // anything except null/undefined is fine.
+ // those are "magic" in the stream API, because they signal EOF.
+ var objects = [
+ { foo: 'bar' },
+ 100,
+ "string",
+ { nested: { things: [ { foo: 'bar' }, 100, "string" ] } }
+ ];
+
+ var ended = false;
+ js.on('end', function() {
+ ended = true;
+ });
+
+ objects.forEach(function(obj) {
+ js.write(obj);
+ var res = js.read();
+ t.equal(res, JSON.stringify(obj));
+ });
+
+ js.end();
+
+ process.nextTick(function() {
+ t.ok(ended);
+ t.end();
+ })
+});
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-unpipe-drain.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-unpipe-drain.js
new file mode 100644
index 000000000..a3b539454
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-unpipe-drain.js
@@ -0,0 +1,76 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+
+var common = require('../common.js');
+var assert = require('assert');
+var stream = require('../../readable');
+var crypto = require('crypto');
+
+var util = require('util');
+
+function TestWriter() {
+ stream.Writable.call(this);
+}
+util.inherits(TestWriter, stream.Writable);
+
+TestWriter.prototype._write = function (buffer, encoding, callback) {
+ console.log('write called');
+ // super slow write stream (callback never called)
+};
+
+var dest = new TestWriter();
+
+function TestReader(id) {
+ stream.Readable.call(this);
+ this.reads = 0;
+}
+util.inherits(TestReader, stream.Readable);
+
+TestReader.prototype._read = function (size) {
+ this.reads += 1;
+ this.push(crypto.randomBytes(size));
+};
+
+var src1 = new TestReader();
+var src2 = new TestReader();
+
+src1.pipe(dest);
+
+src1.once('readable', function () {
+ process.nextTick(function () {
+
+ src2.pipe(dest);
+
+ src2.once('readable', function () {
+ process.nextTick(function () {
+
+ src1.unpipe(dest);
+ });
+ });
+ });
+});
+
+
+process.on('exit', function () {
+ assert.equal(src1.reads, 2);
+ assert.equal(src2.reads, 2);
+});
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-unpipe-leak.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-unpipe-leak.js
new file mode 100644
index 000000000..6882f2093
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-unpipe-leak.js
@@ -0,0 +1,74 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+
+var common = require('../common.js');
+var assert = require('assert');
+var stream = require('../../readable');
+
+var chunk = new Buffer('hallo');
+
+var util = require('util');
+
+function TestWriter() {
+ stream.Writable.call(this);
+}
+util.inherits(TestWriter, stream.Writable);
+
+TestWriter.prototype._write = function(buffer, encoding, callback) {
+ callback(null);
+};
+
+var dest = new TestWriter();
+
+// Set this high so that we'd trigger a nextTick warning
+// and/or RangeError if we do maybeReadMore wrong.
+function TestReader() {
+ stream.Readable.call(this, { highWaterMark: 0x10000 });
+}
+util.inherits(TestReader, stream.Readable);
+
+TestReader.prototype._read = function(size) {
+ this.push(chunk);
+};
+
+var src = new TestReader();
+
+for (var i = 0; i < 10; i++) {
+ src.pipe(dest);
+ src.unpipe(dest);
+}
+
+assert.equal(src.listeners('end').length, 0);
+assert.equal(src.listeners('readable').length, 0);
+
+assert.equal(dest.listeners('unpipe').length, 0);
+assert.equal(dest.listeners('drain').length, 0);
+assert.equal(dest.listeners('error').length, 0);
+assert.equal(dest.listeners('close').length, 0);
+assert.equal(dest.listeners('finish').length, 0);
+
+console.error(src._readableState);
+process.on('exit', function() {
+ assert(src._readableState.length >= src._readableState.highWaterMark);
+ src._readableState.buffer.length = 0;
+ console.error(src._readableState);
+});
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-writable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-writable.js
new file mode 100644
index 000000000..a60e65cd8
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/test/simple/test-stream2-writable.js
@@ -0,0 +1,328 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+var common = require('../common.js');
+var W = require('../../lib/_stream_writable');
+var D = require('../../lib/_stream_duplex');
+var assert = require('assert');
+
+var util = require('util');
+util.inherits(TestWriter, W);
+
+function TestWriter() {
+ W.apply(this, arguments);
+ this.buffer = [];
+ this.written = 0;
+}
+
+TestWriter.prototype._write = function(chunk, encoding, cb) {
+ // simulate a small unpredictable latency
+ setTimeout(function() {
+ this.buffer.push(chunk.toString());
+ this.written += chunk.length;
+ cb();
+ }.bind(this), Math.floor(Math.random() * 10));
+};
+
+var chunks = new Array(50);
+for (var i = 0; i < chunks.length; i++) {
+ chunks[i] = new Array(i + 1).join('x');
+}
+
+// tiny node-tap lookalike.
+var tests = [];
+var count = 0;
+
+function test(name, fn) {
+ count++;
+ tests.push([name, fn]);
+}
+
+function run() {
+ var next = tests.shift();
+ if (!next)
+ return console.error('ok');
+
+ var name = next[0];
+ var fn = next[1];
+ console.log('# %s', name);
+ fn({
+ same: assert.deepEqual,
+ equal: assert.equal,
+ end: function () {
+ count--;
+ run();
+ }
+ });
+}
+
+// ensure all tests have run
+process.on("exit", function () {
+ assert.equal(count, 0);
+});
+
+process.nextTick(run);
+
+test('write fast', function(t) {
+ var tw = new TestWriter({
+ highWaterMark: 100
+ });
+
+ tw.on('finish', function() {
+ t.same(tw.buffer, chunks, 'got chunks in the right order');
+ t.end();
+ });
+
+ chunks.forEach(function(chunk) {
+ // screw backpressure. Just buffer it all up.
+ tw.write(chunk);
+ });
+ tw.end();
+});
+
+test('write slow', function(t) {
+ var tw = new TestWriter({
+ highWaterMark: 100
+ });
+
+ tw.on('finish', function() {
+ t.same(tw.buffer, chunks, 'got chunks in the right order');
+ t.end();
+ });
+
+ var i = 0;
+ (function W() {
+ tw.write(chunks[i++]);
+ if (i < chunks.length)
+ setTimeout(W, 10);
+ else
+ tw.end();
+ })();
+});
+
+test('write backpressure', function(t) {
+ var tw = new TestWriter({
+ highWaterMark: 50
+ });
+
+ var drains = 0;
+
+ tw.on('finish', function() {
+ t.same(tw.buffer, chunks, 'got chunks in the right order');
+ t.equal(drains, 17);
+ t.end();
+ });
+
+ tw.on('drain', function() {
+ drains++;
+ });
+
+ var i = 0;
+ (function W() {
+ do {
+ var ret = tw.write(chunks[i++]);
+ } while (ret !== false && i < chunks.length);
+
+ if (i < chunks.length) {
+ assert(tw._writableState.length >= 50);
+ tw.once('drain', W);
+ } else {
+ tw.end();
+ }
+ })();
+});
+
+test('write bufferize', function(t) {
+ var tw = new TestWriter({
+ highWaterMark: 100
+ });
+
+ var encodings =
+ [ 'hex',
+ 'utf8',
+ 'utf-8',
+ 'ascii',
+ 'binary',
+ 'base64',
+ 'ucs2',
+ 'ucs-2',
+ 'utf16le',
+ 'utf-16le',
+ undefined ];
+
+ tw.on('finish', function() {
+ t.same(tw.buffer, chunks, 'got the expected chunks');
+ });
+
+ chunks.forEach(function(chunk, i) {
+ var enc = encodings[ i % encodings.length ];
+ chunk = new Buffer(chunk);
+ tw.write(chunk.toString(enc), enc);
+ });
+ t.end();
+});
+
+test('write no bufferize', function(t) {
+ var tw = new TestWriter({
+ highWaterMark: 100,
+ decodeStrings: false
+ });
+
+ tw._write = function(chunk, encoding, cb) {
+ assert(typeof chunk === 'string');
+ chunk = new Buffer(chunk, encoding);
+ return TestWriter.prototype._write.call(this, chunk, encoding, cb);
+ };
+
+ var encodings =
+ [ 'hex',
+ 'utf8',
+ 'utf-8',
+ 'ascii',
+ 'binary',
+ 'base64',
+ 'ucs2',
+ 'ucs-2',
+ 'utf16le',
+ 'utf-16le',
+ undefined ];
+
+ tw.on('finish', function() {
+ t.same(tw.buffer, chunks, 'got the expected chunks');
+ });
+
+ chunks.forEach(function(chunk, i) {
+ var enc = encodings[ i % encodings.length ];
+ chunk = new Buffer(chunk);
+ tw.write(chunk.toString(enc), enc);
+ });
+ t.end();
+});
+
+test('write callbacks', function (t) {
+ var callbacks = chunks.map(function(chunk, i) {
+ return [i, function(er) {
+ callbacks._called[i] = chunk;
+ }];
+ }).reduce(function(set, x) {
+ set['callback-' + x[0]] = x[1];
+ return set;
+ }, {});
+ callbacks._called = [];
+
+ var tw = new TestWriter({
+ highWaterMark: 100
+ });
+
+ tw.on('finish', function() {
+ process.nextTick(function() {
+ t.same(tw.buffer, chunks, 'got chunks in the right order');
+ t.same(callbacks._called, chunks, 'called all callbacks');
+ t.end();
+ });
+ });
+
+ chunks.forEach(function(chunk, i) {
+ tw.write(chunk, callbacks['callback-' + i]);
+ });
+ tw.end();
+});
+
+test('end callback', function (t) {
+ var tw = new TestWriter();
+ tw.end(function () {
+ t.end();
+ });
+});
+
+test('end callback with chunk', function (t) {
+ var tw = new TestWriter();
+ tw.end(new Buffer('hello world'), function () {
+ t.end();
+ });
+});
+
+test('end callback with chunk and encoding', function (t) {
+ var tw = new TestWriter();
+ tw.end('hello world', 'ascii', function () {
+ t.end();
+ });
+});
+
+test('end callback after .write() call', function (t) {
+ var tw = new TestWriter();
+ tw.write(new Buffer('hello world'));
+ tw.end(function () {
+ t.end();
+ });
+});
+
+test('encoding should be ignored for buffers', function(t) {
+ var tw = new W();
+ var hex = '018b5e9a8f6236ffe30e31baf80d2cf6eb';
+ tw._write = function(chunk, encoding, cb) {
+ t.equal(chunk.toString('hex'), hex);
+ t.end();
+ };
+ var buf = new Buffer(hex, 'hex');
+ tw.write(buf, 'binary');
+});
+
+test('writables are not pipable', function(t) {
+ var w = new W();
+ w._write = function() {};
+ var gotError = false;
+ w.on('error', function(er) {
+ gotError = true;
+ });
+ w.pipe(process.stdout);
+ assert(gotError);
+ t.end();
+});
+
+test('duplexes are pipable', function(t) {
+ var d = new D();
+ d._read = function() {};
+ d._write = function() {};
+ var gotError = false;
+ d.on('error', function(er) {
+ gotError = true;
+ });
+ d.pipe(process.stdout);
+ assert(!gotError);
+ t.end();
+});
+
+test('end(chunk) two times is an error', function(t) {
+ var w = new W();
+ w._write = function() {};
+ var gotError = false;
+ w.on('error', function(er) {
+ gotError = true;
+ t.equal(er.message, 'write after end');
+ });
+ w.end('this is the end');
+ w.end('and so is this');
+ process.nextTick(function() {
+ assert(gotError);
+ t.end();
+ });
+});
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/transform.js b/deps/npm/node_modules/sha/node_modules/readable-stream/transform.js
new file mode 100644
index 000000000..5d482f078
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/transform.js
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_transform.js")
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/writable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/writable.js
new file mode 100644
index 000000000..e1e9efdf3
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/writable.js
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_writable.js")
diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/zlib.js b/deps/npm/node_modules/sha/node_modules/readable-stream/zlib.js
new file mode 100644
index 000000000..a30ca2091
--- /dev/null
+++ b/deps/npm/node_modules/sha/node_modules/readable-stream/zlib.js
@@ -0,0 +1,452 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+var Transform = require('./lib/_stream_transform.js');
+
+var binding = process.binding('zlib');
+var util = require('util');
+var assert = require('assert').ok;
+
+// zlib doesn't provide these, so kludge them in following the same
+// const naming scheme zlib uses.
+binding.Z_MIN_WINDOWBITS = 8;
+binding.Z_MAX_WINDOWBITS = 15;
+binding.Z_DEFAULT_WINDOWBITS = 15;
+
+// fewer than 64 bytes per chunk is stupid.
+// technically it could work with as few as 8, but even 64 bytes
+// is absurdly low. Usually a MB or more is best.
+binding.Z_MIN_CHUNK = 64;
+binding.Z_MAX_CHUNK = Infinity;
+binding.Z_DEFAULT_CHUNK = (16 * 1024);
+
+binding.Z_MIN_MEMLEVEL = 1;
+binding.Z_MAX_MEMLEVEL = 9;
+binding.Z_DEFAULT_MEMLEVEL = 8;
+
+binding.Z_MIN_LEVEL = -1;
+binding.Z_MAX_LEVEL = 9;
+binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;
+
+// expose all the zlib constants
+Object.keys(binding).forEach(function(k) {
+ if (k.match(/^Z/)) exports[k] = binding[k];
+});
+
+// translation table for return codes.
+exports.codes = {
+ Z_OK: binding.Z_OK,
+ Z_STREAM_END: binding.Z_STREAM_END,
+ Z_NEED_DICT: binding.Z_NEED_DICT,
+ Z_ERRNO: binding.Z_ERRNO,
+ Z_STREAM_ERROR: binding.Z_STREAM_ERROR,
+ Z_DATA_ERROR: binding.Z_DATA_ERROR,
+ Z_MEM_ERROR: binding.Z_MEM_ERROR,
+ Z_BUF_ERROR: binding.Z_BUF_ERROR,
+ Z_VERSION_ERROR: binding.Z_VERSION_ERROR
+};
+
+Object.keys(exports.codes).forEach(function(k) {
+ exports.codes[exports.codes[k]] = k;
+});
+
+exports.Deflate = Deflate;
+exports.Inflate = Inflate;
+exports.Gzip = Gzip;
+exports.Gunzip = Gunzip;
+exports.DeflateRaw = DeflateRaw;
+exports.InflateRaw = InflateRaw;
+exports.Unzip = Unzip;
+
+exports.createDeflate = function(o) {
+ return new Deflate(o);
+};
+
+exports.createInflate = function(o) {
+ return new Inflate(o);
+};
+
+exports.createDeflateRaw = function(o) {
+ return new DeflateRaw(o);
+};
+
+exports.createInflateRaw = function(o) {
+ return new InflateRaw(o);
+};
+
+exports.createGzip = function(o) {
+ return new Gzip(o);
+};
+
+exports.createGunzip = function(o) {
+ return new Gunzip(o);
+};
+
+exports.createUnzip = function(o) {
+ return new Unzip(o);
+};
+
+
+// Convenience methods.
+// compress/decompress a string or buffer in one step.
+exports.deflate = function(buffer, callback) {
+ zlibBuffer(new Deflate(), buffer, callback);
+};
+
+exports.gzip = function(buffer, callback) {
+ zlibBuffer(new Gzip(), buffer, callback);
+};
+
+exports.deflateRaw = function(buffer, callback) {
+ zlibBuffer(new DeflateRaw(), buffer, callback);
+};
+
+exports.unzip = function(buffer, callback) {
+ zlibBuffer(new Unzip(), buffer, callback);
+};
+
+exports.inflate = function(buffer, callback) {
+ zlibBuffer(new Inflate(), buffer, callback);
+};
+
+exports.gunzip = function(buffer, callback) {
+ zlibBuffer(new Gunzip(), buffer, callback);
+};
+
+exports.inflateRaw = function(buffer, callback) {
+ zlibBuffer(new InflateRaw(), buffer, callback);
+};
+
+function zlibBuffer(engine, buffer, callback) {
+ var buffers = [];
+ var nread = 0;
+
+ engine.on('error', onError);
+ engine.on('end', onEnd);
+
+ engine.end(buffer);
+ flow();
+
+ function flow() {
+ var chunk;
+ while (null !== (chunk = engine.read())) {
+ buffers.push(chunk);
+ nread += chunk.length;
+ }
+ engine.once('readable', flow);
+ }
+
+ function onError(err) {
+ engine.removeListener('end', onEnd);
+ engine.removeListener('readable', flow);
+ callback(err);
+ }
+
+ function onEnd() {
+ var buf = Buffer.concat(buffers, nread);
+ buffers = [];
+ callback(null, buf);
+ }
+}
+
+
+// generic zlib
+// minimal 2-byte header
+function Deflate(opts) {
+ if (!(this instanceof Deflate)) return new Deflate(opts);
+ Zlib.call(this, opts, binding.DEFLATE);
+}
+
+function Inflate(opts) {
+ if (!(this instanceof Inflate)) return new Inflate(opts);
+ Zlib.call(this, opts, binding.INFLATE);
+}
+
+
+
+// gzip - bigger header, same deflate compression
+function Gzip(opts) {
+ if (!(this instanceof Gzip)) return new Gzip(opts);
+ Zlib.call(this, opts, binding.GZIP);
+}
+
+function Gunzip(opts) {
+ if (!(this instanceof Gunzip)) return new Gunzip(opts);
+ Zlib.call(this, opts, binding.GUNZIP);
+}
+
+
+
+// raw - no header
+function DeflateRaw(opts) {
+ if (!(this instanceof DeflateRaw)) return new DeflateRaw(opts);
+ Zlib.call(this, opts, binding.DEFLATERAW);
+}
+
+function InflateRaw(opts) {
+ if (!(this instanceof InflateRaw)) return new InflateRaw(opts);
+ Zlib.call(this, opts, binding.INFLATERAW);
+}
+
+
+// auto-detect header.
+function Unzip(opts) {
+ if (!(this instanceof Unzip)) return new Unzip(opts);
+ Zlib.call(this, opts, binding.UNZIP);
+}
+
+
+// the Zlib class they all inherit from
+// This thing manages the queue of requests, and returns
+// true or false if there is anything in the queue when
+// you call the .write() method.
+
+function Zlib(opts, mode) {
+ this._opts = opts = opts || {};
+ this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK;
+
+ Transform.call(this, opts);
+
+ // means a different thing there.
+ this._readableState.chunkSize = null;
+
+ if (opts.chunkSize) {
+ if (opts.chunkSize < exports.Z_MIN_CHUNK ||
+ opts.chunkSize > exports.Z_MAX_CHUNK) {
+ throw new Error('Invalid chunk size: ' + opts.chunkSize);
+ }
+ }
+
+ if (opts.windowBits) {
+ if (opts.windowBits < exports.Z_MIN_WINDOWBITS ||
+ opts.windowBits > exports.Z_MAX_WINDOWBITS) {
+ throw new Error('Invalid windowBits: ' + opts.windowBits);
+ }
+ }
+
+ if (opts.level) {
+ if (opts.level < exports.Z_MIN_LEVEL ||
+ opts.level > exports.Z_MAX_LEVEL) {
+ throw new Error('Invalid compression level: ' + opts.level);
+ }
+ }
+
+ if (opts.memLevel) {
+ if (opts.memLevel < exports.Z_MIN_MEMLEVEL ||
+ opts.memLevel > exports.Z_MAX_MEMLEVEL) {
+ throw new Error('Invalid memLevel: ' + opts.memLevel);
+ }
+ }
+
+ if (opts.strategy) {
+ if (opts.strategy != exports.Z_FILTERED &&
+ opts.strategy != exports.Z_HUFFMAN_ONLY &&
+ opts.strategy != exports.Z_RLE &&
+ opts.strategy != exports.Z_FIXED &&
+ opts.strategy != exports.Z_DEFAULT_STRATEGY) {
+ throw new Error('Invalid strategy: ' + opts.strategy);
+ }
+ }
+
+ if (opts.dictionary) {
+ if (!Buffer.isBuffer(opts.dictionary)) {
+ throw new Error('Invalid dictionary: it should be a Buffer instance');
+ }
+ }
+
+ this._binding = new binding.Zlib(mode);
+
+ var self = this;
+ this._hadError = false;
+ this._binding.onerror = function(message, errno) {
+ // there is no way to cleanly recover.
+ // continuing only obscures problems.
+ self._binding = null;
+ self._hadError = true;
+
+ var error = new Error(message);
+ error.errno = errno;
+ error.code = exports.codes[errno];
+ self.emit('error', error);
+ };
+
+ this._binding.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS,
+ opts.level || exports.Z_DEFAULT_COMPRESSION,
+ opts.memLevel || exports.Z_DEFAULT_MEMLEVEL,
+ opts.strategy || exports.Z_DEFAULT_STRATEGY,
+ opts.dictionary);
+
+ this._buffer = new Buffer(this._chunkSize);
+ this._offset = 0;
+ this._closed = false;
+
+ this.once('end', this.close);
+}
+
+util.inherits(Zlib, Transform);
+
+Zlib.prototype.reset = function reset() {
+ return this._binding.reset();
+};
+
+Zlib.prototype._flush = function(output, callback) {
+ var rs = this._readableState;
+ var self = this;
+ this._transform(null, output, function(er) {
+ if (er)
+ return callback(er);
+
+ // now a weird thing happens... it could be that you called flush
+ // but everything had already actually been consumed, but it wasn't
+ // enough to get over the Readable class's lowWaterMark.
+ // In that case, we emit 'readable' now to make sure it's consumed.
+ if (rs.length &&
+ rs.length < rs.lowWaterMark &&
+ !rs.ended &&
+ rs.needReadable)
+ self.emit('readable');
+
+ callback();
+ });
+};
+
+Zlib.prototype.flush = function(callback) {
+ var ws = this._writableState;
+ var ts = this._transformState;
+
+ if (ws.writing) {
+ ws.needDrain = true;
+ var self = this;
+ this.once('drain', function() {
+ self._flush(ts.output, callback);
+ });
+ return;
+ }
+
+ this._flush(ts.output, callback || function() {});
+};
+
+Zlib.prototype.close = function(callback) {
+ if (callback)
+ process.nextTick(callback);
+
+ if (this._closed)
+ return;
+
+ this._closed = true;
+
+ this._binding.close();
+
+ var self = this;
+ process.nextTick(function() {
+ self.emit('close');
+ });
+};
+
+Zlib.prototype._transform = function(chunk, output, cb) {
+ var flushFlag;
+ var ws = this._writableState;
+ var ending = ws.ending || ws.ended;
+ var last = ending && (!chunk || ws.length === chunk.length);
+
+ if (chunk !== null && !Buffer.isBuffer(chunk))
+ return cb(new Error('invalid input'));
+
+ // If it's the last chunk, or a final flush, we use the Z_FINISH flush flag.
+ // If it's explicitly flushing at some other time, then we use
+ // Z_FULL_FLUSH. Otherwise, use Z_NO_FLUSH for maximum compression
+ // goodness.
+ if (last)
+ flushFlag = binding.Z_FINISH;
+ else if (chunk === null)
+ flushFlag = binding.Z_FULL_FLUSH;
+ else
+ flushFlag = binding.Z_NO_FLUSH;
+
+ var availInBefore = chunk && chunk.length;
+ var availOutBefore = this._chunkSize - this._offset;
+ var inOff = 0;
+
+ var req = this._binding.write(flushFlag,
+ chunk, // in
+ inOff, // in_off
+ availInBefore, // in_len
+ this._buffer, // out
+ this._offset, //out_off
+ availOutBefore); // out_len
+
+ req.buffer = chunk;
+ req.callback = callback;
+
+ var self = this;
+ function callback(availInAfter, availOutAfter, buffer) {
+ if (self._hadError)
+ return;
+
+ var have = availOutBefore - availOutAfter;
+ assert(have >= 0, 'have should not go down');
+
+ if (have > 0) {
+ var out = self._buffer.slice(self._offset, self._offset + have);
+ self._offset += have;
+ // serve some output to the consumer.
+ output(out);
+ }
+
+ // exhausted the output buffer, or used all the input create a new one.
+ if (availOutAfter === 0 || self._offset >= self._chunkSize) {
+ availOutBefore = self._chunkSize;
+ self._offset = 0;
+ self._buffer = new Buffer(self._chunkSize);
+ }
+
+ if (availOutAfter === 0) {
+ // Not actually done. Need to reprocess.
+ // Also, update the availInBefore to the availInAfter value,
+ // so that if we have to hit it a third (fourth, etc.) time,
+ // it'll have the correct byte counts.
+ inOff += (availInBefore - availInAfter);
+ availInBefore = availInAfter;
+
+ var newReq = self._binding.write(flushFlag,
+ chunk,
+ inOff,
+ availInBefore,
+ self._buffer,
+ self._offset,
+ self._chunkSize);
+ newReq.callback = callback; // this same function
+ newReq.buffer = chunk;
+ return;
+ }
+
+ // finished with the chunk.
+ cb();
+ }
+};
+
+util.inherits(Deflate, Zlib);
+util.inherits(Inflate, Zlib);
+util.inherits(Gzip, Zlib);
+util.inherits(Gunzip, Zlib);
+util.inherits(DeflateRaw, Zlib);
+util.inherits(InflateRaw, Zlib);
+util.inherits(Unzip, Zlib);
diff --git a/deps/npm/node_modules/sha/package.json b/deps/npm/node_modules/sha/package.json
index c2c7dc6b6..f19b78cdd 100644
--- a/deps/npm/node_modules/sha/package.json
+++ b/deps/npm/node_modules/sha/package.json
@@ -27,5 +27,5 @@
"readable-stream": "1.0"
},
"_id": "sha@1.2.1",
- "_from": "sha@latest"
+ "_from": "sha@~1.2.1"
}
diff --git a/deps/npm/package.json b/deps/npm/package.json
index cda04f33b..0c2802e1a 100644
--- a/deps/npm/package.json
+++ b/deps/npm/package.json
@@ -1,5 +1,5 @@
{
- "version": "1.3.5",
+ "version": "1.3.6",
"name": "npm",
"publishConfig": {
"proprietary-attribs": false
@@ -134,10 +134,5 @@
"dumpconf": "env | grep npm | sort | uniq",
"echo": "node bin/npm-cli.js"
},
- "licenses": [
- {
- "type": "MIT +no-false-attribs",
- "url": "https://github.com/isaacs/npm/raw/master/LICENSE"
- }
- ]
+ "license": "Artistic-2.0"
}