aboutsummaryrefslogtreecommitdiff
path: root/node_modules/orchestrator
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/orchestrator')
-rw-r--r--node_modules/orchestrator/.npmignore10
-rw-r--r--node_modules/orchestrator/LICENSE20
-rw-r--r--node_modules/orchestrator/README.md286
-rw-r--r--node_modules/orchestrator/index.js304
-rw-r--r--node_modules/orchestrator/lib/runTask.js66
-rw-r--r--node_modules/orchestrator/node_modules/end-of-stream/.npmignore1
-rw-r--r--node_modules/orchestrator/node_modules/end-of-stream/README.md47
-rw-r--r--node_modules/orchestrator/node_modules/end-of-stream/index.js61
-rw-r--r--node_modules/orchestrator/node_modules/end-of-stream/package.json31
-rw-r--r--node_modules/orchestrator/node_modules/end-of-stream/test.js59
-rw-r--r--node_modules/orchestrator/node_modules/once/LICENSE15
-rw-r--r--node_modules/orchestrator/node_modules/once/README.md51
-rw-r--r--node_modules/orchestrator/node_modules/once/once.js21
-rw-r--r--node_modules/orchestrator/node_modules/once/package.json33
-rw-r--r--node_modules/orchestrator/package.json35
15 files changed, 0 insertions, 1040 deletions
diff --git a/node_modules/orchestrator/.npmignore b/node_modules/orchestrator/.npmignore
deleted file mode 100644
index 094a5f358..000000000
--- a/node_modules/orchestrator/.npmignore
+++ /dev/null
@@ -1,10 +0,0 @@
-.DS_Store
-*.log
-node_modules
-build
-*.node
-components
-*.orig
-.idea
-test
-.travis.yml
diff --git a/node_modules/orchestrator/LICENSE b/node_modules/orchestrator/LICENSE
deleted file mode 100644
index b7346abd6..000000000
--- a/node_modules/orchestrator/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright (c) 2013 [Richardson & Sons, LLC](http://richardsonandsons.com/)
-
-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/node_modules/orchestrator/README.md b/node_modules/orchestrator/README.md
deleted file mode 100644
index d87844cf4..000000000
--- a/node_modules/orchestrator/README.md
+++ /dev/null
@@ -1,286 +0,0 @@
-[![Build Status](https://secure.travis-ci.org/robrich/orchestrator.svg?branch=master)](https://travis-ci.org/robrich/orchestrator)
-[![Dependency Status](https://david-dm.org/robrich/orchestrator.svg)](https://david-dm.org/robrich/orchestrator)
-
-Orchestrator
-============
-
-A module for sequencing and executing tasks and dependencies in maximum concurrency
-
-Usage
------
-
-### 1. Get a reference:
-
-```javascript
-var Orchestrator = require('orchestrator');
-var orchestrator = new Orchestrator();
-```
-
-### 2. Load it up with stuff to do:
-
-```javascript
-orchestrator.add('thing1', function(){
- // do stuff
-});
-orchestrator.add('thing2', function(){
- // do stuff
-});
-```
-
-### 3. Run the tasks:
-
-```javascript
-orchestrator.start('thing1', 'thing2', function (err) {
- // all done
-});
-```
-
-API
----
-
-### orchestrator.add(name[, deps][, function]);
-
-Define a task
-
-```javascript
-orchestrator.add('thing1', function(){
- // do stuff
-});
-```
-
-#### name
-Type: `String`
-
-The name of the task.
-
-#### deps
-Type: `Array`
-
-An array of task names to be executed and completed before your task will run.
-
-```javascript
-orchestrator.add('mytask', ['array', 'of', 'task', 'names'], function() {
- // Do stuff
-});
-```
-
-**Note:** Are your tasks running before the dependencies are complete? Make sure your dependency tasks
-are correctly using the async run hints: take in a callback or return a promise or event stream.
-
-#### fn
-Type: `function`
-
-The function that performs the task's operations. For asynchronous tasks, you need to provide a hint when the task is complete:
-
-- Take in a callback
-- Return a stream or a promise
-
-#### examples:
-
-**Accept a callback:**
-
-```javascript
-orchestrator.add('thing2', function(callback){
- // do stuff
- callback(err);
-});
-```
-
-**Return a promise:**
-
-```javascript
-var Q = require('q');
-
-orchestrator.add('thing3', function(){
- var deferred = Q.defer();
-
- // do async stuff
- setTimeout(function () {
- deferred.resolve();
- }, 1);
-
- return deferred.promise;
-});
-```
-
-**Return a stream:** (task is marked complete when stream ends)
-
-```javascript
-var map = require('map-stream');
-
-orchestrator.add('thing4', function(){
- var stream = map(function (args, cb) {
- cb(null, args);
- });
- // do stream stuff
- return stream;
-});
-```
-
-**Note:** By default, tasks run with maximum concurrency -- e.g. it launches all the tasks at once and waits for nothing.
-If you want to create a series where tasks run in a particular order, you need to do two things:
-
-- give it a hint to tell it when the task is done,
-- and give it a hint that a task depends on completion of another.
-
-For these examples, let's presume you have two tasks, "one" and "two" that you specifically want to run in this order:
-
-1. In task "one" you add a hint to tell it when the task is done. Either take in a callback and call it when you're
-done or return a promise or stream that the engine should wait to resolve or end respectively.
-
-2. In task "two" you add a hint telling the engine that it depends on completion of the first task.
-
-So this example would look like this:
-
-```javascript
-var Orchestrator = require('orchestrator');
-var orchestrator = new Orchestrator();
-
-// takes in a callback so the engine knows when it'll be done
-orchestrator.add('one', function (cb) {
- // do stuff -- async or otherwise
- cb(err); // if err is not null or undefined, the orchestration will stop, and note that it failed
-});
-
-// identifies a dependent task must be complete before this one begins
-orchestrator.add('two', ['one'], function () {
- // task 'one' is done now
-});
-
-orchestrator.start('one', 'two');
-```
-
-### orchestrator.hasTask(name);
-
-Have you defined a task with this name?
-
-#### name
-Type: `String`
-
-The task name to query
-
-### orchestrator.start(tasks...[, cb]);
-
-Start running the tasks
-
-#### tasks
-Type: `String` or `Array` of `String`s
-
-Tasks to be executed. You may pass any number of tasks as individual arguments.
-
-#### cb
-Type: `function`: `function (err) {`
-
-Callback to call after run completed.
-
-Passes single argument: `err`: did the orchestration succeed?
-
-**Note:** Tasks run concurrently and therefore may not complete in order.
-**Note:** Orchestrator uses `sequencify` to resolve dependencies before running, and therefore may not start in order.
-Listen to orchestration events to watch task running.
-
-```javascript
-orchestrator.start('thing1', 'thing2', 'thing3', 'thing4', function (err) {
- // all done
-});
-```
-```javascript
-orchestrator.start(['thing1','thing2'], ['thing3','thing4']);
-```
-
-**FRAGILE:** Orchestrator catches exceptions on sync runs to pass to your callback
-but doesn't hook to process.uncaughtException so it can't pass those exceptions
-to your callback
-
-**FRAGILE:** Orchestrator will ensure each task and each dependency is run once during an orchestration run
-even if you specify it to run more than once. (e.g. `orchestrator.start('thing1', 'thing1')`
-will only run 'thing1' once.) If you need it to run a task multiple times, wait for
-the orchestration to end (start's callback) then call start again.
-(e.g. `orchestrator.start('thing1', function () {orchestrator.start('thing1');})`.)
-Alternatively create a second orchestrator instance.
-
-### orchestrator.stop()
-
-Stop an orchestration run currently in process
-
-**Note:** It will call the `start()` callback with an `err` noting the orchestration was aborted
-
-### orchestrator.on(event, cb);
-
-Listen to orchestrator internals
-
-#### event
-Type: `String`
-
-Event name to listen to:
-- start: from start() method, shows you the task sequence
-- stop: from stop() method, the queue finished successfully
-- err: from stop() method, the queue was aborted due to a task error
-- task_start: from _runTask() method, task was started
-- task_stop: from _runTask() method, task completed successfully
-- task_err: from _runTask() method, task errored
-- task_not_found: from start() method, you're trying to start a task that doesn't exist
-- task_recursion: from start() method, there are recursive dependencies in your task list
-
-#### cb
-Type: `function`: `function (e) {`
-
-Passes single argument: `e`: event details
-
-```javascript
-orchestrator.on('task_start', function (e) {
- // e.message is the log message
- // e.task is the task name if the message applies to a task else `undefined`
- // e.err is the error if event is 'err' else `undefined`
-});
-// for task_end and task_err:
-orchestrator.on('task_stop', function (e) {
- // e is the same object from task_start
- // e.message is updated to show how the task ended
- // e.duration is the task run duration (in seconds)
-});
-```
-
-**Note:** fires either *stop or *err but not both.
-
-### orchestrator.onAll(cb);
-
-Listen to all orchestrator events from one callback
-
-#### cb
-Type: `function`: `function (e) {`
-
-Passes single argument: `e`: event details
-
-```javascript
-orchestrator.onAll(function (e) {
- // e is the original event args
- // e.src is event name
-});
-```
-
-LICENSE
--------
-
-(MIT License)
-
-Copyright (c) 2013-2015 [Richardson & Sons, LLC](http://richardsonandsons.com/)
-
-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/node_modules/orchestrator/index.js b/node_modules/orchestrator/index.js
deleted file mode 100644
index 89bc7956b..000000000
--- a/node_modules/orchestrator/index.js
+++ /dev/null
@@ -1,304 +0,0 @@
-/*jshint node:true */
-
-"use strict";
-
-var util = require('util');
-var events = require('events');
-var EventEmitter = events.EventEmitter;
-var runTask = require('./lib/runTask');
-
-var Orchestrator = function () {
- EventEmitter.call(this);
- this.doneCallback = undefined; // call this when all tasks in the queue are done
- this.seq = []; // the order to run the tasks
- this.tasks = {}; // task objects: name, dep (list of names of dependencies), fn (the task to run)
- this.isRunning = false; // is the orchestrator running tasks? .start() to start, .stop() to stop
-};
-util.inherits(Orchestrator, EventEmitter);
-
- Orchestrator.prototype.reset = function () {
- if (this.isRunning) {
- this.stop(null);
- }
- this.tasks = {};
- this.seq = [];
- this.isRunning = false;
- this.doneCallback = undefined;
- return this;
- };
- Orchestrator.prototype.add = function (name, dep, fn) {
- if (!fn && typeof dep === 'function') {
- fn = dep;
- dep = undefined;
- }
- dep = dep || [];
- fn = fn || function () {}; // no-op
- if (!name) {
- throw new Error('Task requires a name');
- }
- // validate name is a string, dep is an array of strings, and fn is a function
- if (typeof name !== 'string') {
- throw new Error('Task requires a name that is a string');
- }
- if (typeof fn !== 'function') {
- throw new Error('Task '+name+' requires a function that is a function');
- }
- if (!Array.isArray(dep)) {
- throw new Error('Task '+name+' can\'t support dependencies that is not an array of strings');
- }
- dep.forEach(function (item) {
- if (typeof item !== 'string') {
- throw new Error('Task '+name+' dependency '+item+' is not a string');
- }
- });
- this.tasks[name] = {
- fn: fn,
- dep: dep,
- name: name
- };
- return this;
- };
- Orchestrator.prototype.task = function (name, dep, fn) {
- if (dep || fn) {
- // alias for add, return nothing rather than this
- this.add(name, dep, fn);
- } else {
- return this.tasks[name];
- }
- };
- Orchestrator.prototype.hasTask = function (name) {
- return !!this.tasks[name];
- };
- // tasks and optionally a callback
- Orchestrator.prototype.start = function() {
- var args, arg, names = [], lastTask, i, seq = [];
- args = Array.prototype.slice.call(arguments, 0);
- if (args.length) {
- lastTask = args[args.length-1];
- if (typeof lastTask === 'function') {
- this.doneCallback = lastTask;
- args.pop();
- }
- for (i = 0; i < args.length; i++) {
- arg = args[i];
- if (typeof arg === 'string') {
- names.push(arg);
- } else if (Array.isArray(arg)) {
- names = names.concat(arg); // FRAGILE: ASSUME: it's an array of strings
- } else {
- throw new Error('pass strings or arrays of strings');
- }
- }
- }
- if (this.isRunning) {
- // reset specified tasks (and dependencies) as not run
- this._resetSpecificTasks(names);
- } else {
- // reset all tasks as not run
- this._resetAllTasks();
- }
- if (this.isRunning) {
- // if you call start() again while a previous run is still in play
- // prepend the new tasks to the existing task queue
- names = names.concat(this.seq);
- }
- if (names.length < 1) {
- // run all tasks
- for (i in this.tasks) {
- if (this.tasks.hasOwnProperty(i)) {
- names.push(this.tasks[i].name);
- }
- }
- }
- seq = [];
- try {
- this.sequence(this.tasks, names, seq, []);
- } catch (err) {
- // Is this a known error?
- if (err) {
- if (err.missingTask) {
- this.emit('task_not_found', {message: err.message, task:err.missingTask, err: err});
- }
- if (err.recursiveTasks) {
- this.emit('task_recursion', {message: err.message, recursiveTasks:err.recursiveTasks, err: err});
- }
- }
- this.stop(err);
- return this;
- }
- this.seq = seq;
- this.emit('start', {message:'seq: '+this.seq.join(',')});
- if (!this.isRunning) {
- this.isRunning = true;
- }
- this._runStep();
- return this;
- };
- Orchestrator.prototype.stop = function (err, successfulFinish) {
- this.isRunning = false;
- if (err) {
- this.emit('err', {message:'orchestration failed', err:err});
- } else if (successfulFinish) {
- this.emit('stop', {message:'orchestration succeeded'});
- } else {
- // ASSUME
- err = 'orchestration aborted';
- this.emit('err', {message:'orchestration aborted', err: err});
- }
- if (this.doneCallback) {
- // Avoid calling it multiple times
- this.doneCallback(err);
- } else if (err && !this.listeners('err').length) {
- // No one is listening for the error so speak louder
- throw err;
- }
- };
- Orchestrator.prototype.sequence = require('sequencify');
- Orchestrator.prototype.allDone = function () {
- var i, task, allDone = true; // nothing disputed it yet
- for (i = 0; i < this.seq.length; i++) {
- task = this.tasks[this.seq[i]];
- if (!task.done) {
- allDone = false;
- break;
- }
- }
- return allDone;
- };
- Orchestrator.prototype._resetTask = function(task) {
- if (task) {
- if (task.done) {
- task.done = false;
- }
- delete task.start;
- delete task.stop;
- delete task.duration;
- delete task.hrDuration;
- delete task.args;
- }
- };
- Orchestrator.prototype._resetAllTasks = function() {
- var task;
- for (task in this.tasks) {
- if (this.tasks.hasOwnProperty(task)) {
- this._resetTask(this.tasks[task]);
- }
- }
- };
- Orchestrator.prototype._resetSpecificTasks = function (names) {
- var i, name, t;
-
- if (names && names.length) {
- for (i = 0; i < names.length; i++) {
- name = names[i];
- t = this.tasks[name];
- if (t) {
- this._resetTask(t);
- if (t.dep && t.dep.length) {
- this._resetSpecificTasks(t.dep); // recurse
- }
- //} else {
- // FRAGILE: ignore that the task doesn't exist
- }
- }
- }
- };
- Orchestrator.prototype._runStep = function () {
- var i, task;
- if (!this.isRunning) {
- return; // user aborted, ASSUME: stop called previously
- }
- for (i = 0; i < this.seq.length; i++) {
- task = this.tasks[this.seq[i]];
- if (!task.done && !task.running && this._readyToRunTask(task)) {
- this._runTask(task);
- }
- if (!this.isRunning) {
- return; // task failed or user aborted, ASSUME: stop called previously
- }
- }
- if (this.allDone()) {
- this.stop(null, true);
- }
- };
- Orchestrator.prototype._readyToRunTask = function (task) {
- var ready = true, // no one disproved it yet
- i, name, t;
- if (task.dep.length) {
- for (i = 0; i < task.dep.length; i++) {
- name = task.dep[i];
- t = this.tasks[name];
- if (!t) {
- // FRAGILE: this should never happen
- this.stop("can't run "+task.name+" because it depends on "+name+" which doesn't exist");
- ready = false;
- break;
- }
- if (!t.done) {
- ready = false;
- break;
- }
- }
- }
- return ready;
- };
- Orchestrator.prototype._stopTask = function (task, meta) {
- task.duration = meta.duration;
- task.hrDuration = meta.hrDuration;
- task.running = false;
- task.done = true;
- };
- Orchestrator.prototype._emitTaskDone = function (task, message, err) {
- if (!task.args) {
- task.args = {task:task.name};
- }
- task.args.duration = task.duration;
- task.args.hrDuration = task.hrDuration;
- task.args.message = task.name+' '+message;
- var evt = 'stop';
- if (err) {
- task.args.err = err;
- evt = 'err';
- }
- // 'task_stop' or 'task_err'
- this.emit('task_'+evt, task.args);
- };
- Orchestrator.prototype._runTask = function (task) {
- var that = this;
-
- task.args = {task:task.name, message:task.name+' started'};
- this.emit('task_start', task.args);
- task.running = true;
-
- runTask(task.fn.bind(this), function (err, meta) {
- that._stopTask.call(that, task, meta);
- that._emitTaskDone.call(that, task, meta.runMethod, err);
- if (err) {
- return that.stop.call(that, err);
- }
- that._runStep.call(that);
- });
- };
-
-// FRAGILE: ASSUME: this list is an exhaustive list of events emitted
-var events = ['start','stop','err','task_start','task_stop','task_err','task_not_found','task_recursion'];
-
-var listenToEvent = function (target, event, callback) {
- target.on(event, function (e) {
- e.src = event;
- callback(e);
- });
-};
-
- Orchestrator.prototype.onAll = function (callback) {
- var i;
- if (typeof callback !== 'function') {
- throw new Error('No callback specified');
- }
-
- for (i = 0; i < events.length; i++) {
- listenToEvent(this, events[i], callback);
- }
- };
-
-module.exports = Orchestrator;
diff --git a/node_modules/orchestrator/lib/runTask.js b/node_modules/orchestrator/lib/runTask.js
deleted file mode 100644
index 41b28778b..000000000
--- a/node_modules/orchestrator/lib/runTask.js
+++ /dev/null
@@ -1,66 +0,0 @@
-/*jshint node:true */
-
-"use strict";
-
-var eos = require('end-of-stream');
-var consume = require('stream-consume');
-
-module.exports = function (task, done) {
- var that = this, finish, cb, isDone = false, start, r;
-
- finish = function (err, runMethod) {
- var hrDuration = process.hrtime(start);
-
- if (isDone && !err) {
- err = new Error('task completion callback called too many times');
- }
- isDone = true;
-
- var duration = hrDuration[0] + (hrDuration[1] / 1e9); // seconds
-
- done.call(that, err, {
- duration: duration, // seconds
- hrDuration: hrDuration, // [seconds,nanoseconds]
- runMethod: runMethod
- });
- };
-
- cb = function (err) {
- finish(err, 'callback');
- };
-
- try {
- start = process.hrtime();
- r = task(cb);
- } catch (err) {
- return finish(err, 'catch');
- }
-
- if (r && typeof r.then === 'function') {
- // wait for promise to resolve
- // FRAGILE: ASSUME: Promises/A+, see http://promises-aplus.github.io/promises-spec/
- r.then(function () {
- finish(null, 'promise');
- }, function(err) {
- finish(err, 'promise');
- });
-
- } else if (r && typeof r.pipe === 'function') {
- // wait for stream to end
-
- eos(r, { error: true, readable: r.readable, writable: r.writable && !r.readable }, function(err){
- finish(err, 'stream');
- });
-
- // Ensure that the stream completes
- consume(r);
-
- } else if (task.length === 0) {
- // synchronous, function took in args.length parameters, and the callback was extra
- finish(null, 'sync');
-
- //} else {
- // FRAGILE: ASSUME: callback
-
- }
-};
diff --git a/node_modules/orchestrator/node_modules/end-of-stream/.npmignore b/node_modules/orchestrator/node_modules/end-of-stream/.npmignore
deleted file mode 100644
index 3c3629e64..000000000
--- a/node_modules/orchestrator/node_modules/end-of-stream/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules
diff --git a/node_modules/orchestrator/node_modules/end-of-stream/README.md b/node_modules/orchestrator/node_modules/end-of-stream/README.md
deleted file mode 100644
index df800c1eb..000000000
--- a/node_modules/orchestrator/node_modules/end-of-stream/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# end-of-stream
-
-A node module that calls a callback when a readable/writable/duplex stream has completed or failed.
-
- npm install end-of-stream
-
-## Usage
-
-Simply pass a stream and a callback to the `eos`.
-Both legacy streams and streams2 are supported.
-
-``` js
-var eos = require('end-of-stream');
-
-eos(readableStream, function(err) {
- if (err) return console.log('stream had an error or closed early');
- console.log('stream has ended');
-});
-
-eos(writableStream, function(err) {
- if (err) return console.log('stream had an error or closed early');
- console.log('stream has finished');
-});
-
-eos(duplexStream, function(err) {
- if (err) return console.log('stream had an error or closed early');
- console.log('stream has ended and finished');
-});
-
-eos(duplexStream, {readable:false}, function(err) {
- if (err) return console.log('stream had an error or closed early');
- console.log('stream has ended but might still be writable');
-});
-
-eos(duplexStream, {writable:false}, function(err) {
- if (err) return console.log('stream had an error or closed early');
- console.log('stream has ended but might still be readable');
-});
-
-eos(readableStream, {error:false}, function(err) {
- // do not treat emit('error', err) as a end-of-stream
-});
-```
-
-## License
-
-MIT \ No newline at end of file
diff --git a/node_modules/orchestrator/node_modules/end-of-stream/index.js b/node_modules/orchestrator/node_modules/end-of-stream/index.js
deleted file mode 100644
index b9fbec071..000000000
--- a/node_modules/orchestrator/node_modules/end-of-stream/index.js
+++ /dev/null
@@ -1,61 +0,0 @@
-var once = require('once');
-
-var noop = function() {};
-
-var isRequest = function(stream) {
- return stream.setHeader && typeof stream.abort === 'function';
-};
-
-var eos = function(stream, opts, callback) {
- if (typeof opts === 'function') return eos(stream, null, opts);
- if (!opts) opts = {};
-
- callback = once(callback || noop);
-
- var ws = stream._writableState;
- var rs = stream._readableState;
- var readable = opts.readable || (opts.readable !== false && stream.readable);
- var writable = opts.writable || (opts.writable !== false && stream.writable);
-
- var onlegacyfinish = function() {
- if (!stream.writable) onfinish();
- };
-
- var onfinish = function() {
- writable = false;
- if (!readable) callback();
- };
-
- var onend = function() {
- readable = false;
- if (!writable) callback();
- };
-
- var onclose = function() {
- if (readable && !(rs && rs.ended)) return callback(new Error('premature close'));
- if (writable && !(ws && ws.ended)) return callback(new Error('premature close'));
- };
-
- var onrequest = function() {
- stream.req.on('finish', onfinish);
- };
-
- if (isRequest(stream)) {
- stream.on('complete', onfinish);
- stream.on('abort', onclose);
- if (stream.req) onrequest();
- else stream.on('request', onrequest);
- } else if (writable && !ws) { // legacy streams
- stream.on('end', onlegacyfinish);
- stream.on('close', onlegacyfinish);
- }
-
- stream.on('end', onend);
- stream.on('finish', onfinish);
- if (opts.error !== false) stream.on('error', callback);
- stream.on('close', onclose);
-
- return stream;
-};
-
-module.exports = eos; \ No newline at end of file
diff --git a/node_modules/orchestrator/node_modules/end-of-stream/package.json b/node_modules/orchestrator/node_modules/end-of-stream/package.json
deleted file mode 100644
index 1f64886ac..000000000
--- a/node_modules/orchestrator/node_modules/end-of-stream/package.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "name": "end-of-stream",
- "version": "0.1.5",
- "description": "Call a callback when a readable/writable/duplex stream has completed or failed.",
- "repository": {
- "type": "git",
- "url": "git://github.com/mafintosh/end-of-stream.git"
- },
- "dependencies": {
- "once": "~1.3.0"
- },
- "scripts": {
- "test": "node test.js"
- },
- "keywords": [
- "stream",
- "streams",
- "callback",
- "finish",
- "close",
- "end",
- "wait"
- ],
- "bugs": {
- "url": "https://github.com/mafintosh/end-of-stream/issues"
- },
- "homepage": "https://github.com/mafintosh/end-of-stream",
- "main": "index.js",
- "author": "Mathias Buus <mathiasbuus@gmail.com>",
- "license": "MIT"
-}
diff --git a/node_modules/orchestrator/node_modules/end-of-stream/test.js b/node_modules/orchestrator/node_modules/end-of-stream/test.js
deleted file mode 100644
index 277f1ce61..000000000
--- a/node_modules/orchestrator/node_modules/end-of-stream/test.js
+++ /dev/null
@@ -1,59 +0,0 @@
-var assert = require('assert');
-var eos = require('./index');
-
-var expected = 6;
-var fs = require('fs');
-var net = require('net');
-
-var ws = fs.createWriteStream('/dev/null');
-eos(ws, function(err) {
- expected--;
- assert(!!err);
- if (!expected) process.exit(0);
-});
-ws.close();
-
-var rs = fs.createReadStream('/dev/random');
-eos(rs, function(err) {
- expected--;
- assert(!!err);
- if (!expected) process.exit(0);
-});
-rs.close();
-
-var rs = fs.createReadStream(__filename);
-eos(rs, function(err) {
- expected--;
- assert(!err);
- if (!expected) process.exit(0);
-});
-rs.pipe(fs.createWriteStream('/dev/null'));
-
-var socket = net.connect(50000);
-eos(socket, function(err) {
- expected--;
- assert(!!err);
- if (!expected) process.exit(0);
-});
-
-
-var server = net.createServer(function(socket) {
- eos(socket, function() {
- expected--;
- if (!expected) process.exit(0);
- });
- socket.destroy();
-}).listen(30000, function() {
- var socket = net.connect(30000);
- eos(socket, function() {
- expected--;
- if (!expected) process.exit(0);
- });
-});
-
-
-
-setTimeout(function() {
- assert(expected === 0);
- process.exit(0);
-}, 1000);
diff --git a/node_modules/orchestrator/node_modules/once/LICENSE b/node_modules/orchestrator/node_modules/once/LICENSE
deleted file mode 100644
index 19129e315..000000000
--- a/node_modules/orchestrator/node_modules/once/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter and Contributors
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/orchestrator/node_modules/once/README.md b/node_modules/orchestrator/node_modules/once/README.md
deleted file mode 100644
index a2981ea07..000000000
--- a/node_modules/orchestrator/node_modules/once/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# once
-
-Only call a function once.
-
-## usage
-
-```javascript
-var once = require('once')
-
-function load (file, cb) {
- cb = once(cb)
- loader.load('file')
- loader.once('load', cb)
- loader.once('error', cb)
-}
-```
-
-Or add to the Function.prototype in a responsible way:
-
-```javascript
-// only has to be done once
-require('once').proto()
-
-function load (file, cb) {
- cb = cb.once()
- loader.load('file')
- loader.once('load', cb)
- loader.once('error', cb)
-}
-```
-
-Ironically, the prototype feature makes this module twice as
-complicated as necessary.
-
-To check whether you function has been called, use `fn.called`. Once the
-function is called for the first time the return value of the original
-function is saved in `fn.value` and subsequent calls will continue to
-return this value.
-
-```javascript
-var once = require('once')
-
-function load (cb) {
- cb = once(cb)
- var stream = createStream()
- stream.once('data', cb)
- stream.once('end', function () {
- if (!cb.called) cb(new Error('not found'))
- })
-}
-```
diff --git a/node_modules/orchestrator/node_modules/once/once.js b/node_modules/orchestrator/node_modules/once/once.js
deleted file mode 100644
index 2e1e721bf..000000000
--- a/node_modules/orchestrator/node_modules/once/once.js
+++ /dev/null
@@ -1,21 +0,0 @@
-var wrappy = require('wrappy')
-module.exports = wrappy(once)
-
-once.proto = once(function () {
- Object.defineProperty(Function.prototype, 'once', {
- value: function () {
- return once(this)
- },
- configurable: true
- })
-})
-
-function once (fn) {
- var f = function () {
- if (f.called) return f.value
- f.called = true
- return f.value = fn.apply(this, arguments)
- }
- f.called = false
- return f
-}
diff --git a/node_modules/orchestrator/node_modules/once/package.json b/node_modules/orchestrator/node_modules/once/package.json
deleted file mode 100644
index 28fe2ff72..000000000
--- a/node_modules/orchestrator/node_modules/once/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "once",
- "version": "1.3.3",
- "description": "Run a function exactly one time",
- "main": "once.js",
- "directories": {
- "test": "test"
- },
- "dependencies": {
- "wrappy": "1"
- },
- "devDependencies": {
- "tap": "^1.2.0"
- },
- "scripts": {
- "test": "tap test/*.js"
- },
- "files": [
- "once.js"
- ],
- "repository": {
- "type": "git",
- "url": "git://github.com/isaacs/once"
- },
- "keywords": [
- "once",
- "function",
- "one",
- "single"
- ],
- "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
- "license": "ISC"
-}
diff --git a/node_modules/orchestrator/package.json b/node_modules/orchestrator/package.json
deleted file mode 100644
index 7107bfd93..000000000
--- a/node_modules/orchestrator/package.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "name": "orchestrator",
- "description": "A module for sequencing and executing tasks and dependencies in maximum concurrency",
- "version": "0.3.8",
- "homepage": "https://github.com/robrich/orchestrator",
- "repository": "git://github.com/robrich/orchestrator.git",
- "author": "Rob Richardson (http://robrich.org/)",
- "main": "./index.js",
- "keywords": [
- "async",
- "task",
- "parallel",
- "compose"
- ],
- "dependencies": {
- "end-of-stream": "~0.1.5",
- "sequencify": "~0.0.7",
- "stream-consume": "~0.1.0"
- },
- "devDependencies": {
- "event-stream": "~3.3.4",
- "gulp-uglify": "^2.0.0",
- "jshint": "^2.9.4",
- "map-stream": "~0.0.6",
- "merge-stream": "~1.0.0",
- "mocha": "~3.1.2",
- "q": "~1.4.1",
- "should": "~11.1.1",
- "vinyl-fs": "~2.4.4"
- },
- "scripts": {
- "test": "mocha"
- },
- "license": "MIT"
-}