summaryrefslogtreecommitdiff
path: root/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-08-13 12:29:07 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-08-13 12:29:22 +0200
commitda736d8259331a8ef13bf4bbb10bbb8a5c0e5299 (patch)
tree4d849133b1c9a9c7067e96ff7dd8faa1d927e0bb /deps/node/deps/npm/node_modules/sorted-union-stream/node_modules
parentda228cf9d71b747f1824e85127039e5afc7effd8 (diff)
downloadakono-da736d8259331a8ef13bf4bbb10bbb8a5c0e5299.tar.gz
akono-da736d8259331a8ef13bf4bbb10bbb8a5c0e5299.tar.bz2
akono-da736d8259331a8ef13bf4bbb10bbb8a5c0e5299.zip
remove node/v8 from source tree
Diffstat (limited to 'deps/node/deps/npm/node_modules/sorted-union-stream/node_modules')
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/LICENSE.md21
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/README.md67
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/index.js93
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/package.json69
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/test.js86
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/README.md54
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/build/build.js208
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/component.json19
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/index.js3
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/package.json57
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/.npmignore5
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/LICENSE18
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/README.md14
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/duplex.js1
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/float.patch922
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_duplex.js89
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_passthrough.js46
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_readable.js951
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_transform.js209
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_writable.js477
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/package.json65
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/passthrough.js1
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/readable.js10
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/transform.js1
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/writable.js1
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/.npmignore2
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/LICENSE20
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/README.md7
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/index.js221
-rw-r--r--deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/package.json53
30 files changed, 0 insertions, 3790 deletions
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/LICENSE.md b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/LICENSE.md
deleted file mode 100644
index 146cb32a..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/LICENSE.md
+++ /dev/null
@@ -1,21 +0,0 @@
-## The MIT License (MIT) ##
-
-Copyright (c) 2014 Hugh Kennedy
-
-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.
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/README.md b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/README.md
deleted file mode 100644
index a890140b..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-# from2 [![Flattr this!](https://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=hughskennedy&url=http://github.com/hughsk/from2&title=from2&description=hughsk/from2%20on%20GitHub&language=en_GB&tags=flattr,github,javascript&category=software)[![experimental](http://hughsk.github.io/stability-badges/dist/experimental.svg)](http://github.com/hughsk/stability-badges) #
-
-`from2` is a high-level module for creating readable streams that properly handle backpressure.
-
-Convience wrapper for
-[readable-stream](http://github.com/isaacs/readable-stream)'s `ReadableStream`
-base class, with an API lifted from
-[from](http://github.com/dominictarr/from) and
-[through2](http://github.com/rvagg/through2).
-
-## Usage ##
-
-[![from2](https://nodei.co/npm/from2.png?mini=true)](https://nodei.co/npm/from2)
-
-### `stream = from2([opts], read)` ###
-
-Where `opts` are the options to pass on to the `ReadableStream` constructor,
-and `read(size, next)` is called when data is requested from the stream.
-
-* `size` is the recommended amount of data (in bytes) to retrieve.
-* `next(err)` should be called when you're ready to emit more data.
-
-For example, here's a readable stream that emits the contents of a given
-string:
-
-``` javascript
-var from = require('from2')
-
-module.exports = fromString
-
-function fromString(string) {
- return from(function(size, next) {
- // if there's no more content
- // left in the string, close the stream.
- if (string.length <= 0) return this.push(null)
-
- // Pull in a new chunk of text,
- // removing it from the string.
- var chunk = string.slice(0, size)
- string = string.slice(size)
-
- // Emit "chunk" from the stream.
- next(null, chunk)
- })
-}
-
-// pipe "hello world" out
-// to stdout.
-fromString('hello world').pipe(process.stdout)
-```
-
-### `stream = from2.obj([opts], read)` ###
-
-Shorthand for `from2({ objectMode: true }, read)`.
-
-### `createStream = from2.ctor([opts], read)` ###
-
-If you're creating similar streams in quick succession you can improve
-performance by generating a stream **constructor** that you can reuse instead
-of creating one-off streams on each call.
-
-Takes the same options as `from2`, instead returning a constructor which you
-can use to create new streams.
-
-## License ##
-
-MIT. See [LICENSE.md](http://github.com/hughsk/from2/blob/master/LICENSE.md) for details.
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/index.js b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/index.js
deleted file mode 100644
index d83be0b5..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/index.js
+++ /dev/null
@@ -1,93 +0,0 @@
-var Readable = require('readable-stream').Readable
-var inherits = require('inherits')
-
-module.exports = from2
-
-from2.ctor = ctor
-from2.obj = obj
-
-var Proto = ctor()
-
-function toFunction(list) {
- list = list.slice()
- return function (_, cb) {
- cb(null, list.length ? list.shift() : null)
- }
-}
-
-function from2(opts, read) {
- if (typeof opts !== 'object' || Array.isArray(opts)) {
- read = opts
- opts = {}
- }
-
- if (Array.isArray(read)) read = toFunction(read)
-
- var rs = new Proto(opts)
- rs._from = read
- return rs
-}
-
-function ctor(opts, read) {
- if (typeof opts === 'function') {
- read = opts
- opts = {}
- }
-
- opts = defaults(opts)
-
- inherits(Class, Readable)
- function Class(override) {
- if (!(this instanceof Class)) return new Class(override)
- this._reading = false
- this.destroyed = false
- Readable.call(this, override || opts)
- }
-
- Class.prototype._from = read
- Class.prototype._read = function(size) {
- var self = this
-
- if (this._reading || this.destroyed) return
- this._reading = true
- this._from(size, check)
- function check(err, data) {
- if (self.destroyed) return
- if (err) return self.destroy(err)
- if (data === null) return self.push(null)
- self._reading = false
- if (self.push(data)) self._read()
- }
- }
-
- Class.prototype.destroy = function(err) {
- if (this.destroyed) return
- this.destroyed = true
-
- var self = this
- process.nextTick(function() {
- if (err) self.emit('error', err)
- self.emit('close')
- })
- }
-
- return Class
-}
-
-function obj(opts, read) {
- if (typeof opts === 'function' || Array.isArray(opts)) {
- read = opts
- opts = {}
- }
-
- opts = defaults(opts)
- opts.objectMode = true
- opts.highWaterMark = 16
-
- return from2(opts, read)
-}
-
-function defaults(opts) {
- opts = opts || {}
- return opts
-}
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/package.json b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/package.json
deleted file mode 100644
index f5932495..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/package.json
+++ /dev/null
@@ -1,69 +0,0 @@
-{
- "_from": "from2@^1.3.0",
- "_id": "from2@1.3.0",
- "_inBundle": false,
- "_integrity": "sha1-iEE7qqX5pZfP3pIh2GmGzTwGHf0=",
- "_location": "/sorted-union-stream/from2",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "from2@^1.3.0",
- "name": "from2",
- "escapedName": "from2",
- "rawSpec": "^1.3.0",
- "saveSpec": null,
- "fetchSpec": "^1.3.0"
- },
- "_requiredBy": [
- "/sorted-union-stream"
- ],
- "_resolved": "https://registry.npmjs.org/from2/-/from2-1.3.0.tgz",
- "_shasum": "88413baaa5f9a597cfde9221d86986cd3c061dfd",
- "_spec": "from2@^1.3.0",
- "_where": "/Users/rebecca/code/npm/node_modules/sorted-union-stream",
- "author": {
- "name": "Hugh Kennedy",
- "email": "hughskennedy@gmail.com",
- "url": "http://hughsk.io/"
- },
- "bugs": {
- "url": "https://github.com/hughsk/from2/issues"
- },
- "bundleDependencies": false,
- "contributors": [
- {
- "name": "Mathias Buus",
- "email": "mathiasbuus@gmail.com"
- }
- ],
- "dependencies": {
- "inherits": "~2.0.1",
- "readable-stream": "~1.1.10"
- },
- "deprecated": false,
- "description": "Convenience wrapper for ReadableStream, with an API lifted from \"from\" and \"through2\"",
- "devDependencies": {
- "tape": "~2.4.2"
- },
- "homepage": "https://github.com/hughsk/from2",
- "keywords": [
- "from",
- "stream",
- "readable",
- "pull",
- "convenience",
- "wrapper"
- ],
- "license": "MIT",
- "main": "index.js",
- "name": "from2",
- "repository": {
- "type": "git",
- "url": "git://github.com/hughsk/from2.git"
- },
- "scripts": {
- "test": "node test"
- },
- "version": "1.3.0"
-}
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/test.js b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/test.js
deleted file mode 100644
index aee04635..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/from2/test.js
+++ /dev/null
@@ -1,86 +0,0 @@
-var test = require('tape')
-var path = require('path')
-var from = require('./')
-var fs = require('fs')
-
-var tmp = path.resolve(
- __dirname, 'tmp.txt'
-)
-
-function fromString(string) {
- return from(function(size, next) {
- if (string.length <= 0) return next()
- var chunk = string.slice(0, size)
- string = string.slice(size)
- next(null, chunk)
- })
-}
-
-test('from2', function(t) {
- var contents = fs.readFileSync(__filename, 'utf8')
- var stream = fromString(contents)
-
- stream
- .pipe(fs.createWriteStream(tmp))
- .on('close', function() {
- t.equal(fs.readFileSync(tmp, 'utf8'), contents)
- fs.unlinkSync(tmp)
- t.end()
- })
-})
-
-test('old mode', function(t) {
- var contents = fs.readFileSync(__filename, 'utf8')
- var stream = fromString(contents)
- var buffer = ''
-
- stream.on('data', function(data) {
- buffer += data
- }).on('end', function() {
- t.equal(buffer, contents)
- t.end()
- })
-})
-
-test('destroy', function(t) {
- var stream = from(function(size, next) {
- process.nextTick(function() {
- next(null, 'no')
- })
- })
-
- stream.on('data', function(data) {
- t.ok(false)
- }).on('close', function() {
- t.ok(true)
- t.end()
- })
-
- stream.destroy()
-})
-
-test('arrays', function (t) {
- var input = ['a', 'b', 'c']
- var stream = from(input)
- var output = []
- stream.on('data', function (letter) {
- output.push(letter.toString())
- })
- stream.on('end', function () {
- t.deepEqual(input, output)
- t.end()
- })
-})
-
-test('obj arrays', function (t) {
- var input = [{foo:'a'}, {foo:'b'}, {foo:'c'}]
- var stream = from.obj(input)
- var output = []
- stream.on('data', function (letter) {
- output.push(letter)
- })
- stream.on('end', function () {
- t.deepEqual(input, output)
- t.end()
- })
-})
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/README.md b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/README.md
deleted file mode 100644
index 052a62b8..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-
-# isarray
-
-`Array#isArray` for older browsers.
-
-## Usage
-
-```js
-var isArray = require('isarray');
-
-console.log(isArray([])); // => true
-console.log(isArray({})); // => false
-```
-
-## Installation
-
-With [npm](http://npmjs.org) do
-
-```bash
-$ npm install isarray
-```
-
-Then bundle for the browser with
-[browserify](https://github.com/substack/browserify).
-
-With [component](http://component.io) do
-
-```bash
-$ component install juliangruber/isarray
-```
-
-## License
-
-(MIT)
-
-Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
-
-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.
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/build/build.js b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/build/build.js
deleted file mode 100644
index e1856ef0..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/build/build.js
+++ /dev/null
@@ -1,208 +0,0 @@
-
-/**
- * Require the given path.
- *
- * @param {String} path
- * @return {Object} exports
- * @api public
- */
-
-function require(path, parent, orig) {
- var resolved = require.resolve(path);
-
- // lookup failed
- if (null == resolved) {
- orig = orig || path;
- parent = parent || 'root';
- var err = new Error('Failed to require "' + orig + '" from "' + parent + '"');
- err.path = orig;
- err.parent = parent;
- err.require = true;
- throw err;
- }
-
- var module = require.modules[resolved];
-
- // perform real require()
- // by invoking the module's
- // registered function
- if (!module.exports) {
- module.exports = {};
- module.client = module.component = true;
- module.call(this, module.exports, require.relative(resolved), module);
- }
-
- return module.exports;
-}
-
-/**
- * Registered modules.
- */
-
-require.modules = {};
-
-/**
- * Registered aliases.
- */
-
-require.aliases = {};
-
-/**
- * Resolve `path`.
- *
- * Lookup:
- *
- * - PATH/index.js
- * - PATH.js
- * - PATH
- *
- * @param {String} path
- * @return {String} path or null
- * @api private
- */
-
-require.resolve = function(path) {
- if (path.charAt(0) === '/') path = path.slice(1);
- var index = path + '/index.js';
-
- var paths = [
- path,
- path + '.js',
- path + '.json',
- path + '/index.js',
- path + '/index.json'
- ];
-
- for (var i = 0; i < paths.length; i++) {
- var path = paths[i];
- if (require.modules.hasOwnProperty(path)) return path;
- }
-
- if (require.aliases.hasOwnProperty(index)) {
- return require.aliases[index];
- }
-};
-
-/**
- * Normalize `path` relative to the current path.
- *
- * @param {String} curr
- * @param {String} path
- * @return {String}
- * @api private
- */
-
-require.normalize = function(curr, path) {
- var segs = [];
-
- if ('.' != path.charAt(0)) return path;
-
- curr = curr.split('/');
- path = path.split('/');
-
- for (var i = 0; i < path.length; ++i) {
- if ('..' == path[i]) {
- curr.pop();
- } else if ('.' != path[i] && '' != path[i]) {
- segs.push(path[i]);
- }
- }
-
- return curr.concat(segs).join('/');
-};
-
-/**
- * Register module at `path` with callback `definition`.
- *
- * @param {String} path
- * @param {Function} definition
- * @api private
- */
-
-require.register = function(path, definition) {
- require.modules[path] = definition;
-};
-
-/**
- * Alias a module definition.
- *
- * @param {String} from
- * @param {String} to
- * @api private
- */
-
-require.alias = function(from, to) {
- if (!require.modules.hasOwnProperty(from)) {
- throw new Error('Failed to alias "' + from + '", it does not exist');
- }
- require.aliases[to] = from;
-};
-
-/**
- * Return a require function relative to the `parent` path.
- *
- * @param {String} parent
- * @return {Function}
- * @api private
- */
-
-require.relative = function(parent) {
- var p = require.normalize(parent, '..');
-
- /**
- * lastIndexOf helper.
- */
-
- function lastIndexOf(arr, obj) {
- var i = arr.length;
- while (i--) {
- if (arr[i] === obj) return i;
- }
- return -1;
- }
-
- /**
- * The relative require() itself.
- */
-
- function localRequire(path) {
- var resolved = localRequire.resolve(path);
- return require(resolved, parent, path);
- }
-
- /**
- * Resolve relative to the parent.
- */
-
- localRequire.resolve = function(path) {
- var c = path.charAt(0);
- if ('/' == c) return path.slice(1);
- if ('.' == c) return require.normalize(p, path);
-
- // resolve deps by returning
- // the dep in the nearest "deps"
- // directory
- var segs = parent.split('/');
- var i = lastIndexOf(segs, 'deps') + 1;
- if (!i) i = 0;
- path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
- return path;
- };
-
- /**
- * Check if module is defined at `path`.
- */
-
- localRequire.exists = function(path) {
- return require.modules.hasOwnProperty(localRequire.resolve(path));
- };
-
- return localRequire;
-};
-require.register("isarray/index.js", function(exports, require, module){
-module.exports = Array.isArray || function (arr) {
- return Object.prototype.toString.call(arr) == '[object Array]';
-};
-
-});
-require.alias("isarray/index.js", "isarray/index.js");
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/component.json b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/component.json
deleted file mode 100644
index 9e31b683..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/component.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "name" : "isarray",
- "description" : "Array#isArray for older browsers",
- "version" : "0.0.1",
- "repository" : "juliangruber/isarray",
- "homepage": "https://github.com/juliangruber/isarray",
- "main" : "index.js",
- "scripts" : [
- "index.js"
- ],
- "dependencies" : {},
- "keywords": ["browser","isarray","array"],
- "author": {
- "name": "Julian Gruber",
- "email": "mail@juliangruber.com",
- "url": "http://juliangruber.com"
- },
- "license": "MIT"
-}
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/index.js b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/index.js
deleted file mode 100644
index 5f5ad45d..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = Array.isArray || function (arr) {
- return Object.prototype.toString.call(arr) == '[object Array]';
-};
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/package.json b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/package.json
deleted file mode 100644
index 7ffb7408..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/isarray/package.json
+++ /dev/null
@@ -1,57 +0,0 @@
-{
- "_from": "isarray@0.0.1",
- "_id": "isarray@0.0.1",
- "_inBundle": false,
- "_integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
- "_location": "/sorted-union-stream/isarray",
- "_phantomChildren": {},
- "_requested": {
- "type": "version",
- "registry": true,
- "raw": "isarray@0.0.1",
- "name": "isarray",
- "escapedName": "isarray",
- "rawSpec": "0.0.1",
- "saveSpec": null,
- "fetchSpec": "0.0.1"
- },
- "_requiredBy": [
- "/sorted-union-stream/readable-stream"
- ],
- "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
- "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf",
- "_spec": "isarray@0.0.1",
- "_where": "/Users/rebecca/code/npm/node_modules/sorted-union-stream/node_modules/readable-stream",
- "author": {
- "name": "Julian Gruber",
- "email": "mail@juliangruber.com",
- "url": "http://juliangruber.com"
- },
- "bugs": {
- "url": "https://github.com/juliangruber/isarray/issues"
- },
- "bundleDependencies": false,
- "dependencies": {},
- "deprecated": false,
- "description": "Array#isArray for older browsers",
- "devDependencies": {
- "tap": "*"
- },
- "homepage": "https://github.com/juliangruber/isarray",
- "keywords": [
- "browser",
- "isarray",
- "array"
- ],
- "license": "MIT",
- "main": "index.js",
- "name": "isarray",
- "repository": {
- "type": "git",
- "url": "git://github.com/juliangruber/isarray.git"
- },
- "scripts": {
- "test": "tap test/*.js"
- },
- "version": "0.0.1"
-}
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/.npmignore b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/.npmignore
deleted file mode 100644
index 38344f87..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/.npmignore
+++ /dev/null
@@ -1,5 +0,0 @@
-build/
-test/
-examples/
-fs.js
-zlib.js \ No newline at end of file
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/LICENSE b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/LICENSE
deleted file mode 100644
index e3d4e695..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/LICENSE
+++ /dev/null
@@ -1,18 +0,0 @@
-Copyright Joyent, Inc. and other Node contributors. All rights reserved.
-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.
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/README.md b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/README.md
deleted file mode 100644
index 9e9b6eee..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# readable-stream
-
-***Node-core streams for userland***
-
-[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)
-[![NPM](https://nodei.co/npm-dl/readable-stream.png&months=6&height=3)](https://nodei.co/npm/readable-stream/)
-
-This package is a mirror of the Streams2 and Streams3 implementations in Node-core.
-
-If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core.
-
-**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12.
-
-**readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"`
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/duplex.js b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/duplex.js
deleted file mode 100644
index ca807af8..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/duplex.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require("./lib/_stream_duplex.js")
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/float.patch b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/float.patch
deleted file mode 100644
index 7abb6dc3..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/float.patch
+++ /dev/null
@@ -1,922 +0,0 @@
-diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js
-index c5a741c..a2e0d8e 100644
---- a/lib/_stream_duplex.js
-+++ b/lib/_stream_duplex.js
-@@ -26,8 +26,8 @@
-
- module.exports = Duplex;
- var util = require('util');
--var Readable = require('_stream_readable');
--var Writable = require('_stream_writable');
-+var Readable = require('./_stream_readable');
-+var Writable = require('./_stream_writable');
-
- util.inherits(Duplex, Readable);
-
-diff --git a/lib/_stream_passthrough.js b/lib/_stream_passthrough.js
-index a5e9864..330c247 100644
---- a/lib/_stream_passthrough.js
-+++ b/lib/_stream_passthrough.js
-@@ -25,7 +25,7 @@
-
- module.exports = PassThrough;
-
--var Transform = require('_stream_transform');
-+var Transform = require('./_stream_transform');
- var util = require('util');
- util.inherits(PassThrough, Transform);
-
-diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js
-index 0c3fe3e..90a8298 100644
---- a/lib/_stream_readable.js
-+++ b/lib/_stream_readable.js
-@@ -23,10 +23,34 @@ module.exports = Readable;
- Readable.ReadableState = ReadableState;
-
- var EE = require('events').EventEmitter;
-+if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
-+ return emitter.listeners(type).length;
-+};
-+
-+if (!global.setImmediate) global.setImmediate = function setImmediate(fn) {
-+ return setTimeout(fn, 0);
-+};
-+if (!global.clearImmediate) global.clearImmediate = function clearImmediate(i) {
-+ return clearTimeout(i);
-+};
-+
- var Stream = require('stream');
- var util = require('util');
-+if (!util.isUndefined) {
-+ var utilIs = require('core-util-is');
-+ for (var f in utilIs) {
-+ util[f] = utilIs[f];
-+ }
-+}
- var StringDecoder;
--var debug = util.debuglog('stream');
-+var debug;
-+if (util.debuglog)
-+ debug = util.debuglog('stream');
-+else try {
-+ debug = require('debuglog')('stream');
-+} catch (er) {
-+ debug = function() {};
-+}
-
- util.inherits(Readable, Stream);
-
-@@ -380,7 +404,7 @@ function chunkInvalid(state, chunk) {
-
-
- function onEofChunk(stream, state) {
-- if (state.decoder && !state.ended) {
-+ if (state.decoder && !state.ended && state.decoder.end) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) {
- state.buffer.push(chunk);
-diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js
-index b1f9fcc..b0caf57 100644
---- a/lib/_stream_transform.js
-+++ b/lib/_stream_transform.js
-@@ -64,8 +64,14 @@
-
- module.exports = Transform;
-
--var Duplex = require('_stream_duplex');
-+var Duplex = require('./_stream_duplex');
- var util = require('util');
-+if (!util.isUndefined) {
-+ var utilIs = require('core-util-is');
-+ for (var f in utilIs) {
-+ util[f] = utilIs[f];
-+ }
-+}
- util.inherits(Transform, Duplex);
-
-
-diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js
-index ba2e920..f49288b 100644
---- a/lib/_stream_writable.js
-+++ b/lib/_stream_writable.js
-@@ -27,6 +27,12 @@ module.exports = Writable;
- Writable.WritableState = WritableState;
-
- var util = require('util');
-+if (!util.isUndefined) {
-+ var utilIs = require('core-util-is');
-+ for (var f in utilIs) {
-+ util[f] = utilIs[f];
-+ }
-+}
- var Stream = require('stream');
-
- util.inherits(Writable, Stream);
-@@ -119,7 +125,7 @@ function WritableState(options, stream) {
- 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 Stream.Duplex))
-+ if (!(this instanceof Writable) && !(this instanceof require('./_stream_duplex')))
- return new Writable(options);
-
- this._writableState = new WritableState(options, this);
-diff --git a/test/simple/test-stream-big-push.js b/test/simple/test-stream-big-push.js
-index e3787e4..8cd2127 100644
---- a/test/simple/test-stream-big-push.js
-+++ b/test/simple/test-stream-big-push.js
-@@ -21,7 +21,7 @@
-
- var common = require('../common');
- var assert = require('assert');
--var stream = require('stream');
-+var stream = require('../../');
- var str = 'asdfasdfasdfasdfasdf';
-
- var r = new stream.Readable({
-diff --git a/test/simple/test-stream-end-paused.js b/test/simple/test-stream-end-paused.js
-index bb73777..d40efc7 100644
---- a/test/simple/test-stream-end-paused.js
-+++ b/test/simple/test-stream-end-paused.js
-@@ -25,7 +25,7 @@ var gotEnd = false;
-
- // Make sure we don't miss the end event for paused 0-length streams
-
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
- var stream = new Readable();
- var calledRead = false;
- stream._read = function() {
-diff --git a/test/simple/test-stream-pipe-after-end.js b/test/simple/test-stream-pipe-after-end.js
-index b46ee90..0be8366 100644
---- a/test/simple/test-stream-pipe-after-end.js
-+++ b/test/simple/test-stream-pipe-after-end.js
-@@ -22,8 +22,8 @@
- var common = require('../common');
- var assert = require('assert');
-
--var Readable = require('_stream_readable');
--var Writable = require('_stream_writable');
-+var Readable = require('../../lib/_stream_readable');
-+var Writable = require('../../lib/_stream_writable');
- var util = require('util');
-
- util.inherits(TestReadable, Readable);
-diff --git a/test/simple/test-stream-pipe-cleanup.js b/test/simple/test-stream-pipe-cleanup.js
-deleted file mode 100644
-index f689358..0000000
---- a/test/simple/test-stream-pipe-cleanup.js
-+++ /dev/null
-@@ -1,122 +0,0 @@
--// 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.
--
--// This test asserts that Stream.prototype.pipe does not leave listeners
--// hanging on the source or dest.
--
--var common = require('../common');
--var stream = require('stream');
--var assert = require('assert');
--var util = require('util');
--
--function Writable() {
-- this.writable = true;
-- this.endCalls = 0;
-- stream.Stream.call(this);
--}
--util.inherits(Writable, stream.Stream);
--Writable.prototype.end = function() {
-- this.endCalls++;
--};
--
--Writable.prototype.destroy = function() {
-- this.endCalls++;
--};
--
--function Readable() {
-- this.readable = true;
-- stream.Stream.call(this);
--}
--util.inherits(Readable, stream.Stream);
--
--function Duplex() {
-- this.readable = true;
-- Writable.call(this);
--}
--util.inherits(Duplex, Writable);
--
--var i = 0;
--var limit = 100;
--
--var w = new Writable();
--
--var r;
--
--for (i = 0; i < limit; i++) {
-- r = new Readable();
-- r.pipe(w);
-- r.emit('end');
--}
--assert.equal(0, r.listeners('end').length);
--assert.equal(limit, w.endCalls);
--
--w.endCalls = 0;
--
--for (i = 0; i < limit; i++) {
-- r = new Readable();
-- r.pipe(w);
-- r.emit('close');
--}
--assert.equal(0, r.listeners('close').length);
--assert.equal(limit, w.endCalls);
--
--w.endCalls = 0;
--
--r = new Readable();
--
--for (i = 0; i < limit; i++) {
-- w = new Writable();
-- r.pipe(w);
-- w.emit('close');
--}
--assert.equal(0, w.listeners('close').length);
--
--r = new Readable();
--w = new Writable();
--var d = new Duplex();
--r.pipe(d); // pipeline A
--d.pipe(w); // pipeline B
--assert.equal(r.listeners('end').length, 2); // A.onend, A.cleanup
--assert.equal(r.listeners('close').length, 2); // A.onclose, A.cleanup
--assert.equal(d.listeners('end').length, 2); // B.onend, B.cleanup
--assert.equal(d.listeners('close').length, 3); // A.cleanup, B.onclose, B.cleanup
--assert.equal(w.listeners('end').length, 0);
--assert.equal(w.listeners('close').length, 1); // B.cleanup
--
--r.emit('end');
--assert.equal(d.endCalls, 1);
--assert.equal(w.endCalls, 0);
--assert.equal(r.listeners('end').length, 0);
--assert.equal(r.listeners('close').length, 0);
--assert.equal(d.listeners('end').length, 2); // B.onend, B.cleanup
--assert.equal(d.listeners('close').length, 2); // B.onclose, B.cleanup
--assert.equal(w.listeners('end').length, 0);
--assert.equal(w.listeners('close').length, 1); // B.cleanup
--
--d.emit('end');
--assert.equal(d.endCalls, 1);
--assert.equal(w.endCalls, 1);
--assert.equal(r.listeners('end').length, 0);
--assert.equal(r.listeners('close').length, 0);
--assert.equal(d.listeners('end').length, 0);
--assert.equal(d.listeners('close').length, 0);
--assert.equal(w.listeners('end').length, 0);
--assert.equal(w.listeners('close').length, 0);
-diff --git a/test/simple/test-stream-pipe-error-handling.js b/test/simple/test-stream-pipe-error-handling.js
-index c5d724b..c7d6b7d 100644
---- a/test/simple/test-stream-pipe-error-handling.js
-+++ b/test/simple/test-stream-pipe-error-handling.js
-@@ -21,7 +21,7 @@
-
- var common = require('../common');
- var assert = require('assert');
--var Stream = require('stream').Stream;
-+var Stream = require('../../').Stream;
-
- (function testErrorListenerCatches() {
- var source = new Stream();
-diff --git a/test/simple/test-stream-pipe-event.js b/test/simple/test-stream-pipe-event.js
-index cb9d5fe..56f8d61 100644
---- a/test/simple/test-stream-pipe-event.js
-+++ b/test/simple/test-stream-pipe-event.js
-@@ -20,7 +20,7 @@
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- var common = require('../common');
--var stream = require('stream');
-+var stream = require('../../');
- var assert = require('assert');
- var util = require('util');
-
-diff --git a/test/simple/test-stream-push-order.js b/test/simple/test-stream-push-order.js
-index f2e6ec2..a5c9bf9 100644
---- a/test/simple/test-stream-push-order.js
-+++ b/test/simple/test-stream-push-order.js
-@@ -20,7 +20,7 @@
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- var common = require('../common.js');
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
- var assert = require('assert');
-
- var s = new Readable({
-diff --git a/test/simple/test-stream-push-strings.js b/test/simple/test-stream-push-strings.js
-index 06f43dc..1701a9a 100644
---- a/test/simple/test-stream-push-strings.js
-+++ b/test/simple/test-stream-push-strings.js
-@@ -22,7 +22,7 @@
- var common = require('../common');
- var assert = require('assert');
-
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
- var util = require('util');
-
- util.inherits(MyStream, Readable);
-diff --git a/test/simple/test-stream-readable-event.js b/test/simple/test-stream-readable-event.js
-index ba6a577..a8e6f7b 100644
---- a/test/simple/test-stream-readable-event.js
-+++ b/test/simple/test-stream-readable-event.js
-@@ -22,7 +22,7 @@
- var common = require('../common');
- var assert = require('assert');
-
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
-
- (function first() {
- // First test, not reading when the readable is added.
-diff --git a/test/simple/test-stream-readable-flow-recursion.js b/test/simple/test-stream-readable-flow-recursion.js
-index 2891ad6..11689ba 100644
---- a/test/simple/test-stream-readable-flow-recursion.js
-+++ b/test/simple/test-stream-readable-flow-recursion.js
-@@ -27,7 +27,7 @@ var assert = require('assert');
- // more data continuously, but without triggering a nextTick
- // warning or RangeError.
-
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
-
- // throw an error if we trigger a nextTick warning.
- process.throwDeprecation = true;
-diff --git a/test/simple/test-stream-unshift-empty-chunk.js b/test/simple/test-stream-unshift-empty-chunk.js
-index 0c96476..7827538 100644
---- a/test/simple/test-stream-unshift-empty-chunk.js
-+++ b/test/simple/test-stream-unshift-empty-chunk.js
-@@ -24,7 +24,7 @@ var assert = require('assert');
-
- // This test verifies that stream.unshift(Buffer(0)) or
- // stream.unshift('') does not set state.reading=false.
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
-
- var r = new Readable();
- var nChunks = 10;
-diff --git a/test/simple/test-stream-unshift-read-race.js b/test/simple/test-stream-unshift-read-race.js
-index 83fd9fa..17c18aa 100644
---- a/test/simple/test-stream-unshift-read-race.js
-+++ b/test/simple/test-stream-unshift-read-race.js
-@@ -29,7 +29,7 @@ var assert = require('assert');
- // 3. push() after the EOF signaling null is an error.
- // 4. _read() is not called after pushing the EOF null chunk.
-
--var stream = require('stream');
-+var stream = require('../../');
- var hwm = 10;
- var r = stream.Readable({ highWaterMark: hwm });
- var chunks = 10;
-@@ -51,7 +51,14 @@ r._read = function(n) {
-
- function push(fast) {
- assert(!pushedNull, 'push() after null push');
-- var c = pos >= data.length ? null : data.slice(pos, pos + n);
-+ var c;
-+ if (pos >= data.length)
-+ c = null;
-+ else {
-+ if (n + pos > data.length)
-+ n = data.length - pos;
-+ c = data.slice(pos, pos + n);
-+ }
- pushedNull = c === null;
- if (fast) {
- pos += n;
-diff --git a/test/simple/test-stream-writev.js b/test/simple/test-stream-writev.js
-index 5b49e6e..b5321f3 100644
---- a/test/simple/test-stream-writev.js
-+++ b/test/simple/test-stream-writev.js
-@@ -22,7 +22,7 @@
- var common = require('../common');
- var assert = require('assert');
-
--var stream = require('stream');
-+var stream = require('../../');
-
- var queue = [];
- for (var decode = 0; decode < 2; decode++) {
-diff --git a/test/simple/test-stream2-basic.js b/test/simple/test-stream2-basic.js
-index 3814bf0..248c1be 100644
---- a/test/simple/test-stream2-basic.js
-+++ b/test/simple/test-stream2-basic.js
-@@ -21,7 +21,7 @@
-
-
- var common = require('../common.js');
--var R = require('_stream_readable');
-+var R = require('../../lib/_stream_readable');
- var assert = require('assert');
-
- var util = require('util');
-diff --git a/test/simple/test-stream2-compatibility.js b/test/simple/test-stream2-compatibility.js
-index 6cdd4e9..f0fa84b 100644
---- a/test/simple/test-stream2-compatibility.js
-+++ b/test/simple/test-stream2-compatibility.js
-@@ -21,7 +21,7 @@
-
-
- var common = require('../common.js');
--var R = require('_stream_readable');
-+var R = require('../../lib/_stream_readable');
- var assert = require('assert');
-
- var util = require('util');
-diff --git a/test/simple/test-stream2-finish-pipe.js b/test/simple/test-stream2-finish-pipe.js
-index 39b274f..006a19b 100644
---- a/test/simple/test-stream2-finish-pipe.js
-+++ b/test/simple/test-stream2-finish-pipe.js
-@@ -20,7 +20,7 @@
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- var common = require('../common.js');
--var stream = require('stream');
-+var stream = require('../../');
- var Buffer = require('buffer').Buffer;
-
- var r = new stream.Readable();
-diff --git a/test/simple/test-stream2-fs.js b/test/simple/test-stream2-fs.js
-deleted file mode 100644
-index e162406..0000000
---- a/test/simple/test-stream2-fs.js
-+++ /dev/null
-@@ -1,72 +0,0 @@
--// 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('_stream_readable');
--var assert = require('assert');
--
--var fs = require('fs');
--var FSReadable = fs.ReadStream;
--
--var path = require('path');
--var file = path.resolve(common.fixturesDir, 'x1024.txt');
--
--var size = fs.statSync(file).size;
--
--var expectLengths = [1024];
--
--var util = require('util');
--var Stream = require('stream');
--
--util.inherits(TestWriter, Stream);
--
--function TestWriter() {
-- Stream.apply(this);
-- this.buffer = [];
-- this.length = 0;
--}
--
--TestWriter.prototype.write = function(c) {
-- this.buffer.push(c.toString());
-- this.length += c.length;
-- return true;
--};
--
--TestWriter.prototype.end = function(c) {
-- if (c) this.buffer.push(c.toString());
-- this.emit('results', this.buffer);
--}
--
--var r = new FSReadable(file);
--var w = new TestWriter();
--
--w.on('results', function(res) {
-- console.error(res, w.length);
-- assert.equal(w.length, size);
-- var l = 0;
-- assert.deepEqual(res.map(function (c) {
-- return c.length;
-- }), expectLengths);
-- console.log('ok');
--});
--
--r.pipe(w);
-diff --git a/test/simple/test-stream2-httpclient-response-end.js b/test/simple/test-stream2-httpclient-response-end.js
-deleted file mode 100644
-index 15cffc2..0000000
---- a/test/simple/test-stream2-httpclient-response-end.js
-+++ /dev/null
-@@ -1,52 +0,0 @@
--// 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 http = require('http');
--var msg = 'Hello';
--var readable_event = false;
--var end_event = false;
--var server = http.createServer(function(req, res) {
-- res.writeHead(200, {'Content-Type': 'text/plain'});
-- res.end(msg);
--}).listen(common.PORT, function() {
-- http.get({port: common.PORT}, function(res) {
-- var data = '';
-- res.on('readable', function() {
-- console.log('readable event');
-- readable_event = true;
-- data += res.read();
-- });
-- res.on('end', function() {
-- console.log('end event');
-- end_event = true;
-- assert.strictEqual(msg, data);
-- server.close();
-- });
-- });
--});
--
--process.on('exit', function() {
-- assert(readable_event);
-- assert(end_event);
--});
--
-diff --git a/test/simple/test-stream2-large-read-stall.js b/test/simple/test-stream2-large-read-stall.js
-index 2fbfbca..667985b 100644
---- a/test/simple/test-stream2-large-read-stall.js
-+++ b/test/simple/test-stream2-large-read-stall.js
-@@ -30,7 +30,7 @@ var PUSHSIZE = 20;
- var PUSHCOUNT = 1000;
- var HWM = 50;
-
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
- var r = new Readable({
- highWaterMark: HWM
- });
-@@ -39,23 +39,23 @@ var rs = r._readableState;
- r._read = push;
-
- r.on('readable', function() {
-- console.error('>> readable');
-+ //console.error('>> readable');
- do {
-- console.error(' > read(%d)', READSIZE);
-+ //console.error(' > read(%d)', READSIZE);
- var ret = r.read(READSIZE);
-- console.error(' < %j (%d remain)', ret && ret.length, rs.length);
-+ //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);
-+ //console.error('<< after read()',
-+ // ret && ret.length,
-+ // rs.needReadable,
-+ // rs.length);
- });
-
- var endEmitted = false;
- r.on('end', function() {
- endEmitted = true;
-- console.error('end');
-+ //console.error('end');
- });
-
- var pushes = 0;
-@@ -64,11 +64,11 @@ function push() {
- return;
-
- if (pushes++ === PUSHCOUNT) {
-- console.error(' push(EOF)');
-+ //console.error(' push(EOF)');
- return r.push(null);
- }
-
-- console.error(' push #%d', pushes);
-+ //console.error(' push #%d', pushes);
- if (r.push(new Buffer(PUSHSIZE)))
- setTimeout(push);
- }
-diff --git a/test/simple/test-stream2-objects.js b/test/simple/test-stream2-objects.js
-index 3e6931d..ff47d89 100644
---- a/test/simple/test-stream2-objects.js
-+++ b/test/simple/test-stream2-objects.js
-@@ -21,8 +21,8 @@
-
-
- var common = require('../common.js');
--var Readable = require('_stream_readable');
--var Writable = require('_stream_writable');
-+var Readable = require('../../lib/_stream_readable');
-+var Writable = require('../../lib/_stream_writable');
- var assert = require('assert');
-
- // tiny node-tap lookalike.
-diff --git a/test/simple/test-stream2-pipe-error-handling.js b/test/simple/test-stream2-pipe-error-handling.js
-index cf7531c..e3f3e4e 100644
---- a/test/simple/test-stream2-pipe-error-handling.js
-+++ b/test/simple/test-stream2-pipe-error-handling.js
-@@ -21,7 +21,7 @@
-
- var common = require('../common');
- var assert = require('assert');
--var stream = require('stream');
-+var stream = require('../../');
-
- (function testErrorListenerCatches() {
- var count = 1000;
-diff --git a/test/simple/test-stream2-pipe-error-once-listener.js b/test/simple/test-stream2-pipe-error-once-listener.js
-index 5e8e3cb..53b2616 100755
---- a/test/simple/test-stream2-pipe-error-once-listener.js
-+++ b/test/simple/test-stream2-pipe-error-once-listener.js
-@@ -24,7 +24,7 @@ var common = require('../common.js');
- var assert = require('assert');
-
- var util = require('util');
--var stream = require('stream');
-+var stream = require('../../');
-
-
- var Read = function() {
-diff --git a/test/simple/test-stream2-push.js b/test/simple/test-stream2-push.js
-index b63edc3..eb2b0e9 100644
---- a/test/simple/test-stream2-push.js
-+++ b/test/simple/test-stream2-push.js
-@@ -20,7 +20,7 @@
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- var common = require('../common.js');
--var stream = require('stream');
-+var stream = require('../../');
- var Readable = stream.Readable;
- var Writable = stream.Writable;
- var assert = require('assert');
-diff --git a/test/simple/test-stream2-read-sync-stack.js b/test/simple/test-stream2-read-sync-stack.js
-index e8a7305..9740a47 100644
---- a/test/simple/test-stream2-read-sync-stack.js
-+++ b/test/simple/test-stream2-read-sync-stack.js
-@@ -21,7 +21,7 @@
-
- var common = require('../common');
- var assert = require('assert');
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
- var r = new Readable();
- var N = 256 * 1024;
-
-diff --git a/test/simple/test-stream2-readable-empty-buffer-no-eof.js b/test/simple/test-stream2-readable-empty-buffer-no-eof.js
-index cd30178..4b1659d 100644
---- a/test/simple/test-stream2-readable-empty-buffer-no-eof.js
-+++ b/test/simple/test-stream2-readable-empty-buffer-no-eof.js
-@@ -22,10 +22,9 @@
- var common = require('../common');
- var assert = require('assert');
-
--var Readable = require('stream').Readable;
-+var Readable = require('../../').Readable;
-
- test1();
--test2();
-
- function test1() {
- var r = new Readable();
-@@ -88,31 +87,3 @@ function test1() {
- 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/test/simple/test-stream2-readable-from-list.js b/test/simple/test-stream2-readable-from-list.js
-index 7c96ffe..04a96f5 100644
---- a/test/simple/test-stream2-readable-from-list.js
-+++ b/test/simple/test-stream2-readable-from-list.js
-@@ -21,7 +21,7 @@
-
- var assert = require('assert');
- var common = require('../common.js');
--var fromList = require('_stream_readable')._fromList;
-+var fromList = require('../../lib/_stream_readable')._fromList;
-
- // tiny node-tap lookalike.
- var tests = [];
-diff --git a/test/simple/test-stream2-readable-legacy-drain.js b/test/simple/test-stream2-readable-legacy-drain.js
-index 675da8e..51fd3d5 100644
---- a/test/simple/test-stream2-readable-legacy-drain.js
-+++ b/test/simple/test-stream2-readable-legacy-drain.js
-@@ -22,7 +22,7 @@
- var common = require('../common');
- var assert = require('assert');
-
--var Stream = require('stream');
-+var Stream = require('../../');
- var Readable = Stream.Readable;
-
- var r = new Readable();
-diff --git a/test/simple/test-stream2-readable-non-empty-end.js b/test/simple/test-stream2-readable-non-empty-end.js
-index 7314ae7..c971898 100644
---- a/test/simple/test-stream2-readable-non-empty-end.js
-+++ b/test/simple/test-stream2-readable-non-empty-end.js
-@@ -21,7 +21,7 @@
-
- var assert = require('assert');
- var common = require('../common.js');
--var Readable = require('_stream_readable');
-+var Readable = require('../../lib/_stream_readable');
-
- var len = 0;
- var chunks = new Array(10);
-diff --git a/test/simple/test-stream2-readable-wrap-empty.js b/test/simple/test-stream2-readable-wrap-empty.js
-index 2e5cf25..fd8a3dc 100644
---- a/test/simple/test-stream2-readable-wrap-empty.js
-+++ b/test/simple/test-stream2-readable-wrap-empty.js
-@@ -22,7 +22,7 @@
- var common = require('../common');
- var assert = require('assert');
-
--var Readable = require('_stream_readable');
-+var Readable = require('../../lib/_stream_readable');
- var EE = require('events').EventEmitter;
-
- var oldStream = new EE();
-diff --git a/test/simple/test-stream2-readable-wrap.js b/test/simple/test-stream2-readable-wrap.js
-index 90eea01..6b177f7 100644
---- a/test/simple/test-stream2-readable-wrap.js
-+++ b/test/simple/test-stream2-readable-wrap.js
-@@ -22,8 +22,8 @@
- var common = require('../common');
- var assert = require('assert');
-
--var Readable = require('_stream_readable');
--var Writable = require('_stream_writable');
-+var Readable = require('../../lib/_stream_readable');
-+var Writable = require('../../lib/_stream_writable');
- var EE = require('events').EventEmitter;
-
- var testRuns = 0, completedRuns = 0;
-diff --git a/test/simple/test-stream2-set-encoding.js b/test/simple/test-stream2-set-encoding.js
-index 5d2c32a..685531b 100644
---- a/test/simple/test-stream2-set-encoding.js
-+++ b/test/simple/test-stream2-set-encoding.js
-@@ -22,7 +22,7 @@
-
- var common = require('../common.js');
- var assert = require('assert');
--var R = require('_stream_readable');
-+var R = require('../../lib/_stream_readable');
- var util = require('util');
-
- // tiny node-tap lookalike.
-diff --git a/test/simple/test-stream2-transform.js b/test/simple/test-stream2-transform.js
-index 9c9ddd8..a0cacc6 100644
---- a/test/simple/test-stream2-transform.js
-+++ b/test/simple/test-stream2-transform.js
-@@ -21,8 +21,8 @@
-
- var assert = require('assert');
- var common = require('../common.js');
--var PassThrough = require('_stream_passthrough');
--var Transform = require('_stream_transform');
-+var PassThrough = require('../../').PassThrough;
-+var Transform = require('../../').Transform;
-
- // tiny node-tap lookalike.
- var tests = [];
-diff --git a/test/simple/test-stream2-unpipe-drain.js b/test/simple/test-stream2-unpipe-drain.js
-index d66dc3c..365b327 100644
---- a/test/simple/test-stream2-unpipe-drain.js
-+++ b/test/simple/test-stream2-unpipe-drain.js
-@@ -22,7 +22,7 @@
-
- var common = require('../common.js');
- var assert = require('assert');
--var stream = require('stream');
-+var stream = require('../../');
- var crypto = require('crypto');
-
- var util = require('util');
-diff --git a/test/simple/test-stream2-unpipe-leak.js b/test/simple/test-stream2-unpipe-leak.js
-index 99f8746..17c92ae 100644
---- a/test/simple/test-stream2-unpipe-leak.js
-+++ b/test/simple/test-stream2-unpipe-leak.js
-@@ -22,7 +22,7 @@
-
- var common = require('../common.js');
- var assert = require('assert');
--var stream = require('stream');
-+var stream = require('../../');
-
- var chunk = new Buffer('hallo');
-
-diff --git a/test/simple/test-stream2-writable.js b/test/simple/test-stream2-writable.js
-index 704100c..209c3a6 100644
---- a/test/simple/test-stream2-writable.js
-+++ b/test/simple/test-stream2-writable.js
-@@ -20,8 +20,8 @@
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- var common = require('../common.js');
--var W = require('_stream_writable');
--var D = require('_stream_duplex');
-+var W = require('../../').Writable;
-+var D = require('../../').Duplex;
- var assert = require('assert');
-
- var util = require('util');
-diff --git a/test/simple/test-stream3-pause-then-read.js b/test/simple/test-stream3-pause-then-read.js
-index b91bde3..2f72c15 100644
---- a/test/simple/test-stream3-pause-then-read.js
-+++ b/test/simple/test-stream3-pause-then-read.js
-@@ -22,7 +22,7 @@
- var common = require('../common');
- var assert = require('assert');
-
--var stream = require('stream');
-+var stream = require('../../');
- var Readable = stream.Readable;
- var Writable = stream.Writable;
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_duplex.js b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_duplex.js
deleted file mode 100644
index b513d61a..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_duplex.js
+++ /dev/null
@@ -1,89 +0,0 @@
-// 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;
-
-/*<replacement>*/
-var objectKeys = Object.keys || function (obj) {
- var keys = [];
- for (var key in obj) keys.push(key);
- return keys;
-}
-/*</replacement>*/
-
-
-/*<replacement>*/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/*</replacement>*/
-
-var Readable = require('./_stream_readable');
-var Writable = require('./_stream_writable');
-
-util.inherits(Duplex, Readable);
-
-forEach(objectKeys(Writable.prototype), 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));
-}
-
-function forEach (xs, f) {
- for (var i = 0, l = xs.length; i < l; i++) {
- f(xs[i], i);
- }
-}
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_passthrough.js
deleted file mode 100644
index 895ca50a..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_passthrough.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// 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');
-
-/*<replacement>*/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/*</replacement>*/
-
-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/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_readable.js b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_readable.js
deleted file mode 100644
index 19ab3588..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_readable.js
+++ /dev/null
@@ -1,951 +0,0 @@
-// 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;
-
-/*<replacement>*/
-var isArray = require('isarray');
-/*</replacement>*/
-
-
-/*<replacement>*/
-var Buffer = require('buffer').Buffer;
-/*</replacement>*/
-
-Readable.ReadableState = ReadableState;
-
-var EE = require('events').EventEmitter;
-
-/*<replacement>*/
-if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
- return emitter.listeners(type).length;
-};
-/*</replacement>*/
-
-var Stream = require('stream');
-
-/*<replacement>*/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/*</replacement>*/
-
-var StringDecoder;
-
-
-/*<replacement>*/
-var debug = require('util');
-if (debug && debug.debuglog) {
- debug = debug.debuglog('stream');
-} else {
- debug = function () {};
-}
-/*</replacement>*/
-
-
-util.inherits(Readable, Stream);
-
-function ReadableState(options, stream) {
- var Duplex = require('./_stream_duplex');
-
- 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;
- var defaultHwm = options.objectMode ? 16 : 16 * 1024;
- this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
-
- // cast to ints.
- this.highWaterMark = ~~this.highWaterMark;
-
- this.buffer = [];
- this.length = 0;
- this.pipes = null;
- this.pipesCount = 0;
- this.flowing = null;
- this.ended = false;
- this.endEmitted = false;
- this.reading = 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, because 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;
- this.readableListening = 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;
-
- if (stream instanceof Duplex)
- this.objectMode = this.objectMode || !!options.readableObjectMode;
-
- // Crypto is kind of old and crusty. Historically, its default string
- // encoding is 'binary' so we have to make this configurable.
- // Everything else in the universe uses 'utf8', though.
- this.defaultEncoding = options.defaultEncoding || 'utf8';
-
- // 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;
- this.encoding = null;
- if (options.encoding) {
- if (!StringDecoder)
- StringDecoder = require('string_decoder/').StringDecoder;
- this.decoder = new StringDecoder(options.encoding);
- this.encoding = options.encoding;
- }
-}
-
-function Readable(options) {
- var Duplex = require('./_stream_duplex');
-
- 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, encoding) {
- var state = this._readableState;
-
- if (util.isString(chunk) && !state.objectMode) {
- encoding = encoding || state.defaultEncoding;
- if (encoding !== state.encoding) {
- chunk = new Buffer(chunk, encoding);
- encoding = '';
- }
- }
-
- return readableAddChunk(this, state, chunk, encoding, false);
-};
-
-// Unshift should *always* be something directly out of read()
-Readable.prototype.unshift = function(chunk) {
- var state = this._readableState;
- return readableAddChunk(this, state, chunk, '', true);
-};
-
-function readableAddChunk(stream, state, chunk, encoding, addToFront) {
- var er = chunkInvalid(state, chunk);
- if (er) {
- stream.emit('error', er);
- } else if (util.isNullOrUndefined(chunk)) {
- state.reading = false;
- if (!state.ended)
- onEofChunk(stream, state);
- } else if (state.objectMode || chunk && chunk.length > 0) {
- if (state.ended && !addToFront) {
- var e = new Error('stream.push() after EOF');
- stream.emit('error', e);
- } else if (state.endEmitted && addToFront) {
- var e = new Error('stream.unshift() after end event');
- stream.emit('error', e);
- } else {
- if (state.decoder && !addToFront && !encoding)
- chunk = state.decoder.write(chunk);
-
- if (!addToFront)
- state.reading = false;
-
- // if we want the data now, just emit it.
- if (state.flowing && state.length === 0 && !state.sync) {
- stream.emit('data', chunk);
- stream.read(0);
- } else {
- // 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);
- }
- } else if (!addToFront) {
- state.reading = false;
- }
-
- 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);
- this._readableState.encoding = enc;
- return this;
-};
-
-// 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) || util.isNull(n)) {
- // 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) {
- debug('read', n);
- var state = this._readableState;
- var nOrig = n;
-
- if (!util.isNumber(n) || 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 || state.ended)) {
- debug('read: emitReadable', state.length, state.ended);
- if (state.length === 0 && state.ended)
- endReadable(this);
- else
- 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;
- debug('need readable', doRead);
-
- // if we currently have less than the highWaterMark, then also read some
- if (state.length === 0 || state.length - n < state.highWaterMark) {
- doRead = true;
- debug('length less than watermark', doRead);
- }
-
- // 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;
- debug('reading or ended', doRead);
- }
-
- if (doRead) {
- debug('do read');
- 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 pushed data 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 (util.isNull(ret)) {
- 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 tried to read() past the EOF, then emit end on the next tick.
- if (nOrig !== n && state.ended && state.length === 0)
- endReadable(this);
-
- if (!util.isNull(ret))
- this.emit('data', ret);
-
- return ret;
-};
-
-function chunkInvalid(state, chunk) {
- var er = null;
- if (!util.isBuffer(chunk) &&
- !util.isString(chunk) &&
- !util.isNullOrUndefined(chunk) &&
- !state.objectMode) {
- er = new TypeError('Invalid non-string/buffer chunk');
- }
- return er;
-}
-
-
-function onEofChunk(stream, state) {
- if (state.decoder && !state.ended) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) {
- state.buffer.push(chunk);
- state.length += state.objectMode ? 1 : chunk.length;
- }
- }
- state.ended = true;
-
- // emit 'readable' now to make sure it gets picked up.
- emitReadable(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) {
- debug('emitReadable', state.flowing);
- state.emittedReadable = true;
- if (state.sync)
- process.nextTick(function() {
- emitReadable_(stream);
- });
- else
- emitReadable_(stream);
- }
-}
-
-function emitReadable_(stream) {
- debug('emit readable');
- stream.emit('readable');
- flow(stream);
-}
-
-
-// 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) {
- debug('maybeReadMore read 0');
- 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;
- debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
-
- 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) {
- debug('onunpipe');
- if (readable === src) {
- cleanup();
- }
- }
-
- function onend() {
- debug('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() {
- debug('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);
- src.removeListener('data', ondata);
-
- // 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 (state.awaitDrain &&
- (!dest._writableState || dest._writableState.needDrain))
- ondrain();
- }
-
- src.on('data', ondata);
- function ondata(chunk) {
- debug('ondata');
- var ret = dest.write(chunk);
- if (false === ret) {
- debug('false write response, pause',
- src._readableState.awaitDrain);
- src._readableState.awaitDrain++;
- src.pause();
- }
- }
-
- // if the dest has an error, then stop piping into it.
- // however, don't suppress the throwing behavior for this.
- function onerror(er) {
- debug('onerror', er);
- unpipe();
- dest.removeListener('error', onerror);
- if (EE.listenerCount(dest, 'error') === 0)
- dest.emit('error', er);
- }
- // This is a brutally ugly hack to make sure that our error handler
- // is attached before any userland ones. NEVER DO THIS.
- if (!dest._events || !dest._events.error)
- dest.on('error', onerror);
- else if (isArray(dest._events.error))
- dest._events.error.unshift(onerror);
- else
- dest._events.error = [onerror, dest._events.error];
-
-
-
- // Both close and finish should trigger unpipe, but only once.
- function onclose() {
- dest.removeListener('finish', onfinish);
- unpipe();
- }
- dest.once('close', onclose);
- function onfinish() {
- debug('onfinish');
- dest.removeListener('close', onclose);
- unpipe();
- }
- dest.once('finish', onfinish);
-
- function unpipe() {
- debug('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) {
- debug('pipe resume');
- src.resume();
- }
-
- return dest;
-};
-
-function pipeOnDrain(src) {
- return function() {
- var state = src._readableState;
- debug('pipeOnDrain', state.awaitDrain);
- if (state.awaitDrain)
- state.awaitDrain--;
- if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) {
- state.flowing = true;
- flow(src);
- }
- };
-}
-
-
-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;
- 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;
- 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 = indexOf(state.pipes, 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 listening to data, and it has not explicitly been paused,
- // then call resume to start the flow of data on the next tick.
- if (ev === 'data' && false !== this._readableState.flowing) {
- this.resume();
- }
-
- if (ev === 'readable' && this.readable) {
- var state = this._readableState;
- if (!state.readableListening) {
- state.readableListening = true;
- state.emittedReadable = false;
- state.needReadable = true;
- if (!state.reading) {
- var self = this;
- process.nextTick(function() {
- debug('readable nexttick read 0');
- self.read(0);
- });
- } else if (state.length) {
- emitReadable(this, state);
- }
- }
- }
-
- 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() {
- var state = this._readableState;
- if (!state.flowing) {
- debug('resume');
- state.flowing = true;
- if (!state.reading) {
- debug('resume read 0');
- this.read(0);
- }
- resume(this, state);
- }
- return this;
-};
-
-function resume(stream, state) {
- if (!state.resumeScheduled) {
- state.resumeScheduled = true;
- process.nextTick(function() {
- resume_(stream, state);
- });
- }
-}
-
-function resume_(stream, state) {
- state.resumeScheduled = false;
- stream.emit('resume');
- flow(stream);
- if (state.flowing && !state.reading)
- stream.read(0);
-}
-
-Readable.prototype.pause = function() {
- debug('call pause flowing=%j', this._readableState.flowing);
- if (false !== this._readableState.flowing) {
- debug('pause');
- this._readableState.flowing = false;
- this.emit('pause');
- }
- return this;
-};
-
-function flow(stream) {
- var state = stream._readableState;
- debug('flow', state.flowing);
- if (state.flowing) {
- do {
- var chunk = stream.read();
- } while (null !== chunk && state.flowing);
- }
-}
-
-// 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() {
- debug('wrapped end');
- if (state.decoder && !state.ended) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length)
- self.push(chunk);
- }
-
- self.push(null);
- });
-
- stream.on('data', function(chunk) {
- debug('wrapped data');
- if (state.decoder)
- chunk = state.decoder.write(chunk);
- if (!chunk || !state.objectMode && !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 (util.isFunction(stream[i]) && util.isUndefined(this[i])) {
- this[i] = function(method) { return function() {
- return stream[method].apply(stream, arguments);
- }}(i);
- }
- }
-
- // proxy certain important events.
- var events = ['error', 'close', 'destroy', 'pause', 'resume'];
- forEach(events, 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) {
- debug('wrapped _read', n);
- if (paused) {
- paused = false;
- stream.resume();
- }
- };
-
- return self;
-};
-
-
-
-// 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.ended = true;
- process.nextTick(function() {
- // Check that we didn't get one last unshift.
- if (!state.endEmitted && state.length === 0) {
- state.endEmitted = true;
- stream.readable = false;
- stream.emit('end');
- }
- });
- }
-}
-
-function forEach (xs, f) {
- for (var i = 0, l = xs.length; i < l; i++) {
- f(xs[i], i);
- }
-}
-
-function indexOf (xs, x) {
- for (var i = 0, l = xs.length; i < l; i++) {
- if (xs[i] === x) return i;
- }
- return -1;
-}
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_transform.js b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_transform.js
deleted file mode 100644
index 905c5e45..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_transform.js
+++ /dev/null
@@ -1,209 +0,0 @@
-// 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');
-
-/*<replacement>*/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/*</replacement>*/
-
-util.inherits(Transform, Duplex);
-
-
-function TransformState(options, stream) {
- 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 (!util.isNullOrUndefined(data))
- stream.push(data);
-
- if (cb)
- cb(er);
-
- var rs = stream._readableState;
- rs.reading = false;
- 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);
-
- 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('prefinish', function() {
- if (util.isFunction(this._flush))
- this._flush(function(er) {
- done(stream, er);
- });
- else
- done(stream);
- });
-}
-
-Transform.prototype.push = function(chunk, encoding) {
- this._transformState.needTransform = false;
- return Duplex.prototype.push.call(this, chunk, encoding);
-};
-
-// 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, encoding, 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.
-// _transform does 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 (!util.isNull(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 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/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_writable.js b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_writable.js
deleted file mode 100644
index db8539cd..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/lib/_stream_writable.js
+++ /dev/null
@@ -1,477 +0,0 @@
-// 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;
-
-/*<replacement>*/
-var Buffer = require('buffer').Buffer;
-/*</replacement>*/
-
-Writable.WritableState = WritableState;
-
-
-/*<replacement>*/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/*</replacement>*/
-
-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) {
- var Duplex = require('./_stream_duplex');
-
- 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;
- var defaultHwm = options.objectMode ? 16 : 16 * 1024;
- this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
-
- // object stream flag to indicate whether or not this stream
- // contains buffers or objects.
- this.objectMode = !!options.objectMode;
-
- if (stream instanceof Duplex)
- this.objectMode = this.objectMode || !!options.writableObjectMode;
-
- // 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;
-
- // Crypto is kind of old and crusty. Historically, its default string
- // encoding is 'binary' so we have to make this configurable.
- // Everything else in the universe uses 'utf8', though.
- this.defaultEncoding = options.defaultEncoding || 'utf8';
-
- // 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;
-
- // when true all writes will be buffered until .uncork() call
- this.corked = 0;
-
- // 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, because 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 = [];
-
- // number of pending user-supplied write callbacks
- // this must be 0 before 'finish' can be emitted
- this.pendingcb = 0;
-
- // emit prefinish if the only thing we're waiting for is _write cbs
- // This is relevant for synchronous Transform streams
- this.prefinished = false;
-
- // True if the error was already emitted and should not be thrown again
- this.errorEmitted = false;
-}
-
-function Writable(options) {
- var Duplex = require('./_stream_duplex');
-
- // Writable ctor is applied to Duplexes, though they're not
- // instanceof Writable, they're instanceof Readable.
- if (!(this instanceof Writable) && !(this instanceof 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 (!util.isBuffer(chunk) &&
- !util.isString(chunk) &&
- !util.isNullOrUndefined(chunk) &&
- !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 (util.isFunction(encoding)) {
- cb = encoding;
- encoding = null;
- }
-
- if (util.isBuffer(chunk))
- encoding = 'buffer';
- else if (!encoding)
- encoding = state.defaultEncoding;
-
- if (!util.isFunction(cb))
- cb = function() {};
-
- if (state.ended)
- writeAfterEnd(this, state, cb);
- else if (validChunk(this, state, chunk, cb)) {
- state.pendingcb++;
- ret = writeOrBuffer(this, state, chunk, encoding, cb);
- }
-
- return ret;
-};
-
-Writable.prototype.cork = function() {
- var state = this._writableState;
-
- state.corked++;
-};
-
-Writable.prototype.uncork = function() {
- var state = this._writableState;
-
- if (state.corked) {
- state.corked--;
-
- if (!state.writing &&
- !state.corked &&
- !state.finished &&
- !state.bufferProcessing &&
- state.buffer.length)
- clearBuffer(this, state);
- }
-};
-
-function decodeChunk(state, chunk, encoding) {
- if (!state.objectMode &&
- state.decodeStrings !== false &&
- util.isString(chunk)) {
- 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);
- if (util.isBuffer(chunk))
- encoding = 'buffer';
- var len = state.objectMode ? 1 : chunk.length;
-
- state.length += len;
-
- var ret = state.length < state.highWaterMark;
- // we must ensure that previous needDrain will not be reset to false.
- if (!ret)
- state.needDrain = true;
-
- if (state.writing || state.corked)
- state.buffer.push(new WriteReq(chunk, encoding, cb));
- else
- doWrite(stream, state, false, len, chunk, encoding, cb);
-
- return ret;
-}
-
-function doWrite(stream, state, writev, len, chunk, encoding, cb) {
- state.writelen = len;
- state.writecb = cb;
- state.writing = true;
- state.sync = true;
- if (writev)
- stream._writev(chunk, state.onwrite);
- else
- stream._write(chunk, encoding, state.onwrite);
- state.sync = false;
-}
-
-function onwriteError(stream, state, sync, er, cb) {
- if (sync)
- process.nextTick(function() {
- state.pendingcb--;
- cb(er);
- });
- else {
- state.pendingcb--;
- cb(er);
- }
-
- stream._writableState.errorEmitted = true;
- 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 {
- // Check if we're actually ready to finish, but don't emit yet
- var finished = needFinish(stream, state);
-
- if (!finished &&
- !state.corked &&
- !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);
- state.pendingcb--;
- cb();
- finishMaybe(stream, state);
-}
-
-// 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;
-
- if (stream._writev && state.buffer.length > 1) {
- // Fast case, write everything using _writev()
- var cbs = [];
- for (var c = 0; c < state.buffer.length; c++)
- cbs.push(state.buffer[c].callback);
-
- // count the one we are adding, as well.
- // TODO(isaacs) clean this up
- state.pendingcb++;
- doWrite(stream, state, true, state.length, state.buffer, '', function(err) {
- for (var i = 0; i < cbs.length; i++) {
- state.pendingcb--;
- cbs[i](err);
- }
- });
-
- // Clear buffer
- state.buffer = [];
- } else {
- // Slow case, write chunks one-by-one
- 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, false, 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;
- }
- }
-
- if (c < state.buffer.length)
- state.buffer = state.buffer.slice(c);
- else
- state.buffer.length = 0;
- }
-
- state.bufferProcessing = false;
-}
-
-Writable.prototype._write = function(chunk, encoding, cb) {
- cb(new Error('not implemented'));
-
-};
-
-Writable.prototype._writev = null;
-
-Writable.prototype.end = function(chunk, encoding, cb) {
- var state = this._writableState;
-
- if (util.isFunction(chunk)) {
- cb = chunk;
- chunk = null;
- encoding = null;
- } else if (util.isFunction(encoding)) {
- cb = encoding;
- encoding = null;
- }
-
- if (!util.isNullOrUndefined(chunk))
- this.write(chunk, encoding);
-
- // .end() fully uncorks
- if (state.corked) {
- state.corked = 1;
- this.uncork();
- }
-
- // ignore unnecessary end() calls.
- if (!state.ending && !state.finished)
- endWritable(this, state, cb);
-};
-
-
-function needFinish(stream, state) {
- return (state.ending &&
- state.length === 0 &&
- !state.finished &&
- !state.writing);
-}
-
-function prefinish(stream, state) {
- if (!state.prefinished) {
- state.prefinished = true;
- stream.emit('prefinish');
- }
-}
-
-function finishMaybe(stream, state) {
- var need = needFinish(stream, state);
- if (need) {
- if (state.pendingcb === 0) {
- prefinish(stream, state);
- state.finished = true;
- stream.emit('finish');
- } else
- prefinish(stream, state);
- }
- return need;
-}
-
-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/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/package.json b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/package.json
deleted file mode 100644
index c09cce6e..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/package.json
+++ /dev/null
@@ -1,65 +0,0 @@
-{
- "_from": "readable-stream@~1.1.10",
- "_id": "readable-stream@1.1.14",
- "_inBundle": false,
- "_integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
- "_location": "/sorted-union-stream/readable-stream",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "readable-stream@~1.1.10",
- "name": "readable-stream",
- "escapedName": "readable-stream",
- "rawSpec": "~1.1.10",
- "saveSpec": null,
- "fetchSpec": "~1.1.10"
- },
- "_requiredBy": [
- "/sorted-union-stream/from2"
- ],
- "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
- "_shasum": "7cf4c54ef648e3813084c636dd2079e166c081d9",
- "_spec": "readable-stream@~1.1.10",
- "_where": "/Users/rebecca/code/npm/node_modules/sorted-union-stream/node_modules/from2",
- "author": {
- "name": "Isaac Z. Schlueter",
- "email": "i@izs.me",
- "url": "http://blog.izs.me/"
- },
- "browser": {
- "util": false
- },
- "bugs": {
- "url": "https://github.com/isaacs/readable-stream/issues"
- },
- "bundleDependencies": false,
- "dependencies": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.1",
- "isarray": "0.0.1",
- "string_decoder": "~0.10.x"
- },
- "deprecated": false,
- "description": "Streams3, a user-land copy of the stream library from Node.js v0.11.x",
- "devDependencies": {
- "tap": "~0.2.6"
- },
- "homepage": "https://github.com/isaacs/readable-stream#readme",
- "keywords": [
- "readable",
- "stream",
- "pipe"
- ],
- "license": "MIT",
- "main": "readable.js",
- "name": "readable-stream",
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/readable-stream.git"
- },
- "scripts": {
- "test": "tap test/simple/*.js"
- },
- "version": "1.1.14"
-}
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/passthrough.js b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/passthrough.js
deleted file mode 100644
index 27e8d8a5..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/passthrough.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require("./lib/_stream_passthrough.js")
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/readable.js b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/readable.js
deleted file mode 100644
index 2a8b5c6b..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/readable.js
+++ /dev/null
@@ -1,10 +0,0 @@
-exports = module.exports = require('./lib/_stream_readable.js');
-exports.Stream = require('stream');
-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');
-if (!process.browser && process.env.READABLE_STREAM === 'disable') {
- module.exports = require('stream');
-}
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/transform.js b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/transform.js
deleted file mode 100644
index 5d482f07..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/transform.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require("./lib/_stream_transform.js")
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/writable.js b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/writable.js
deleted file mode 100644
index e1e9efdf..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/readable-stream/writable.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require("./lib/_stream_writable.js")
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/.npmignore b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/.npmignore
deleted file mode 100644
index 206320cc..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build
-test
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/LICENSE b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/LICENSE
deleted file mode 100644
index 6de584a4..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-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.
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/README.md b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/README.md
deleted file mode 100644
index 4d2aa001..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-**string_decoder.js** (`require('string_decoder')`) from Node.js core
-
-Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details.
-
-Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**
-
-The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/index.js b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/index.js
deleted file mode 100644
index b00e54fb..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/index.js
+++ /dev/null
@@ -1,221 +0,0 @@
-// 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 Buffer = require('buffer').Buffer;
-
-var isBufferEncoding = Buffer.isEncoding
- || function(encoding) {
- switch (encoding && encoding.toLowerCase()) {
- case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
- default: return false;
- }
- }
-
-
-function assertEncoding(encoding) {
- if (encoding && !isBufferEncoding(encoding)) {
- throw new Error('Unknown encoding: ' + encoding);
- }
-}
-
-// StringDecoder provides an interface for efficiently splitting a series of
-// buffers into a series of JS strings without breaking apart multi-byte
-// characters. CESU-8 is handled as part of the UTF-8 encoding.
-//
-// @TODO Handling all encodings inside a single object makes it very difficult
-// to reason about this code, so it should be split up in the future.
-// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
-// points as used by CESU-8.
-var StringDecoder = exports.StringDecoder = function(encoding) {
- this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
- assertEncoding(encoding);
- switch (this.encoding) {
- case 'utf8':
- // CESU-8 represents each of Surrogate Pair by 3-bytes
- this.surrogateSize = 3;
- break;
- case 'ucs2':
- case 'utf16le':
- // UTF-16 represents each of Surrogate Pair by 2-bytes
- this.surrogateSize = 2;
- this.detectIncompleteChar = utf16DetectIncompleteChar;
- break;
- case 'base64':
- // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
- this.surrogateSize = 3;
- this.detectIncompleteChar = base64DetectIncompleteChar;
- break;
- default:
- this.write = passThroughWrite;
- return;
- }
-
- // Enough space to store all bytes of a single character. UTF-8 needs 4
- // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
- this.charBuffer = new Buffer(6);
- // Number of bytes received for the current incomplete multi-byte character.
- this.charReceived = 0;
- // Number of bytes expected for the current incomplete multi-byte character.
- this.charLength = 0;
-};
-
-
-// write decodes the given buffer and returns it as JS string that is
-// guaranteed to not contain any partial multi-byte characters. Any partial
-// character found at the end of the buffer is buffered up, and will be
-// returned when calling write again with the remaining bytes.
-//
-// Note: Converting a Buffer containing an orphan surrogate to a String
-// currently works, but converting a String to a Buffer (via `new Buffer`, or
-// Buffer#write) will replace incomplete surrogates with the unicode
-// replacement character. See https://codereview.chromium.org/121173009/ .
-StringDecoder.prototype.write = function(buffer) {
- var charStr = '';
- // if our last write ended with an incomplete multibyte character
- while (this.charLength) {
- // determine how many remaining bytes this buffer has to offer for this char
- var available = (buffer.length >= this.charLength - this.charReceived) ?
- this.charLength - this.charReceived :
- buffer.length;
-
- // add the new bytes to the char buffer
- buffer.copy(this.charBuffer, this.charReceived, 0, available);
- this.charReceived += available;
-
- if (this.charReceived < this.charLength) {
- // still not enough chars in this buffer? wait for more ...
- return '';
- }
-
- // remove bytes belonging to the current character from the buffer
- buffer = buffer.slice(available, buffer.length);
-
- // get the character that was split
- charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
-
- // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
- var charCode = charStr.charCodeAt(charStr.length - 1);
- if (charCode >= 0xD800 && charCode <= 0xDBFF) {
- this.charLength += this.surrogateSize;
- charStr = '';
- continue;
- }
- this.charReceived = this.charLength = 0;
-
- // if there are no more bytes in this buffer, just emit our char
- if (buffer.length === 0) {
- return charStr;
- }
- break;
- }
-
- // determine and set charLength / charReceived
- this.detectIncompleteChar(buffer);
-
- var end = buffer.length;
- if (this.charLength) {
- // buffer the incomplete character bytes we got
- buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
- end -= this.charReceived;
- }
-
- charStr += buffer.toString(this.encoding, 0, end);
-
- var end = charStr.length - 1;
- var charCode = charStr.charCodeAt(end);
- // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
- if (charCode >= 0xD800 && charCode <= 0xDBFF) {
- var size = this.surrogateSize;
- this.charLength += size;
- this.charReceived += size;
- this.charBuffer.copy(this.charBuffer, size, 0, size);
- buffer.copy(this.charBuffer, 0, 0, size);
- return charStr.substring(0, end);
- }
-
- // or just emit the charStr
- return charStr;
-};
-
-// detectIncompleteChar determines if there is an incomplete UTF-8 character at
-// the end of the given buffer. If so, it sets this.charLength to the byte
-// length that character, and sets this.charReceived to the number of bytes
-// that are available for this character.
-StringDecoder.prototype.detectIncompleteChar = function(buffer) {
- // determine how many bytes we have to check at the end of this buffer
- var i = (buffer.length >= 3) ? 3 : buffer.length;
-
- // Figure out if one of the last i bytes of our buffer announces an
- // incomplete char.
- for (; i > 0; i--) {
- var c = buffer[buffer.length - i];
-
- // See http://en.wikipedia.org/wiki/UTF-8#Description
-
- // 110XXXXX
- if (i == 1 && c >> 5 == 0x06) {
- this.charLength = 2;
- break;
- }
-
- // 1110XXXX
- if (i <= 2 && c >> 4 == 0x0E) {
- this.charLength = 3;
- break;
- }
-
- // 11110XXX
- if (i <= 3 && c >> 3 == 0x1E) {
- this.charLength = 4;
- break;
- }
- }
- this.charReceived = i;
-};
-
-StringDecoder.prototype.end = function(buffer) {
- var res = '';
- if (buffer && buffer.length)
- res = this.write(buffer);
-
- if (this.charReceived) {
- var cr = this.charReceived;
- var buf = this.charBuffer;
- var enc = this.encoding;
- res += buf.slice(0, cr).toString(enc);
- }
-
- return res;
-};
-
-function passThroughWrite(buffer) {
- return buffer.toString(this.encoding);
-}
-
-function utf16DetectIncompleteChar(buffer) {
- this.charReceived = buffer.length % 2;
- this.charLength = this.charReceived ? 2 : 0;
-}
-
-function base64DetectIncompleteChar(buffer) {
- this.charReceived = buffer.length % 3;
- this.charLength = this.charReceived ? 3 : 0;
-}
diff --git a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/package.json b/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/package.json
deleted file mode 100644
index 3c7014f0..00000000
--- a/deps/node/deps/npm/node_modules/sorted-union-stream/node_modules/string_decoder/package.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- "_from": "string_decoder@~0.10.x",
- "_id": "string_decoder@0.10.31",
- "_inBundle": false,
- "_integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
- "_location": "/sorted-union-stream/string_decoder",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "string_decoder@~0.10.x",
- "name": "string_decoder",
- "escapedName": "string_decoder",
- "rawSpec": "~0.10.x",
- "saveSpec": null,
- "fetchSpec": "~0.10.x"
- },
- "_requiredBy": [
- "/sorted-union-stream/readable-stream"
- ],
- "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
- "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
- "_spec": "string_decoder@~0.10.x",
- "_where": "/Users/rebecca/code/npm/node_modules/sorted-union-stream/node_modules/readable-stream",
- "bugs": {
- "url": "https://github.com/rvagg/string_decoder/issues"
- },
- "bundleDependencies": false,
- "dependencies": {},
- "deprecated": false,
- "description": "The string_decoder module from Node core",
- "devDependencies": {
- "tap": "~0.4.8"
- },
- "homepage": "https://github.com/rvagg/string_decoder",
- "keywords": [
- "string",
- "decoder",
- "browser",
- "browserify"
- ],
- "license": "MIT",
- "main": "index.js",
- "name": "string_decoder",
- "repository": {
- "type": "git",
- "url": "git://github.com/rvagg/string_decoder.git"
- },
- "scripts": {
- "test": "tap test/simple/*.js"
- },
- "version": "0.10.31"
-}