diff options
author | Rebecca Turner <me@re-becca.org> | 2018-04-20 18:26:37 -0700 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-05-25 14:03:01 +0200 |
commit | d0cdcb61fe3a237be7d905cecc9ff1b95dbfdfa3 (patch) | |
tree | 9100e1f9c144368752be8c448d65bcd2bc8001a5 /deps/npm/node_modules/worker-farm | |
parent | 1f3eb1cc1ec74b514f6e54fa88537818472bcb4d (diff) | |
download | node-new-d0cdcb61fe3a237be7d905cecc9ff1b95dbfdfa3.tar.gz |
deps: upgrade npm to 6.1.0
PR-URL: https://github.com/nodejs/node/pull/20190
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Diffstat (limited to 'deps/npm/node_modules/worker-farm')
36 files changed, 722 insertions, 1301 deletions
diff --git a/deps/npm/node_modules/worker-farm/.editorconfig b/deps/npm/node_modules/worker-farm/.editorconfig new file mode 100644 index 0000000000..feaebc2315 --- /dev/null +++ b/deps/npm/node_modules/worker-farm/.editorconfig @@ -0,0 +1,16 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[*.js] +max_line_length = 80 +View diff --git a/deps/npm/node_modules/worker-farm/.travis.yml b/deps/npm/node_modules/worker-farm/.travis.yml index 8e23761153..1c9e2b559d 100644 --- a/deps/npm/node_modules/worker-farm/.travis.yml +++ b/deps/npm/node_modules/worker-farm/.travis.yml @@ -3,6 +3,7 @@ node_js: - 4 - 6 - 8 + - 9 branches: only: - master diff --git a/deps/npm/node_modules/worker-farm/README.md b/deps/npm/node_modules/worker-farm/README.md index 87ee4b61b5..982b37cb5d 100644 --- a/deps/npm/node_modules/worker-farm/README.md +++ b/deps/npm/node_modules/worker-farm/README.md @@ -103,7 +103,8 @@ If you don't provide an `options` object then the following defaults will be use ```js { - maxCallsPerWorker : Infinity + workerOptions : {} + , maxCallsPerWorker : Infinity , maxConcurrentWorkers : require('os').cpus().length , maxConcurrentCallsPerWorker : 10 , maxConcurrentCalls : Infinity @@ -113,6 +114,8 @@ If you don't provide an `options` object then the following defaults will be use } ``` + * **<code>workerOptions</code>** allows you to customize all the parameters passed to child nodes. This object supports [all possible options of `child_process.fork`](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options). The default options passed are the parent `execArgv`, `cwd` and `env`. Any (or all) of them can be overridden, and others can be added as well. + * **<code>maxCallsPerWorker</code>** allows you to control the lifespan of your child processes. A positive number will indicate that you only want each child to accept that many calls before it is terminated. This may be useful if you need to control memory leaks or similar in child processes. * **<code>maxConcurrentWorkers</code>** will set the number of child processes to maintain concurrently. By default it is set to the number of CPUs available on the current system, but it can be any reasonable number, including `1`. diff --git a/deps/npm/node_modules/worker-farm/examples/basic/child.js b/deps/npm/node_modules/worker-farm/examples/basic/child.js index 41e124b06e..0f0900b5e2 100644 --- a/deps/npm/node_modules/worker-farm/examples/basic/child.js +++ b/deps/npm/node_modules/worker-farm/examples/basic/child.js @@ -2,4 +2,4 @@ module.exports = function (inp, callback) { callback(null, inp + ' BAR (' + process.pid + ')') -}
\ No newline at end of file +} diff --git a/deps/npm/node_modules/worker-farm/examples/basic/index.js b/deps/npm/node_modules/worker-farm/examples/basic/index.js index 3c9a1086e9..452e7b1630 100644 --- a/deps/npm/node_modules/worker-farm/examples/basic/index.js +++ b/deps/npm/node_modules/worker-farm/examples/basic/index.js @@ -10,4 +10,4 @@ for (let i = 0; i < 10; i++) { if (++ret == 10) workerFarm.end(workers) }) -}
\ No newline at end of file +} diff --git a/deps/npm/node_modules/worker-farm/examples/pi/calc.js b/deps/npm/node_modules/worker-farm/examples/pi/calc.js index 42c77c2bd2..df9e5bae13 100644 --- a/deps/npm/node_modules/worker-farm/examples/pi/calc.js +++ b/deps/npm/node_modules/worker-farm/examples/pi/calc.js @@ -19,4 +19,4 @@ module.exports = function (points, callback) { inside++ callback(null, (inside / points) * 4) -}
\ No newline at end of file +} diff --git a/deps/npm/node_modules/worker-farm/lib/farm.js b/deps/npm/node_modules/worker-farm/lib/farm.js index bdc70e84a1..ef0ab0e105 100644 --- a/deps/npm/node_modules/worker-farm/lib/farm.js +++ b/deps/npm/node_modules/worker-farm/lib/farm.js @@ -1,8 +1,9 @@ 'use strict' const DEFAULT_OPTIONS = { - maxCallsPerWorker : Infinity - , maxConcurrentWorkers : require('os').cpus().length + workerOptions : {} + , maxCallsPerWorker : Infinity + , maxConcurrentWorkers : (require('os').cpus() || { length: 1 }).length , maxConcurrentCallsPerWorker : 10 , maxConcurrentCalls : Infinity , maxCallTime : Infinity // exceed this and the whole worker is terminated @@ -11,15 +12,14 @@ const DEFAULT_OPTIONS = { , autoStart : false } -const extend = require('xtend') - , fork = require('./fork') +const fork = require('./fork') , TimeoutError = require('errno').create('TimeoutError') , ProcessTerminatedError = require('errno').create('ProcessTerminatedError') , MaxConcurrentCallsError = require('errno').create('MaxConcurrentCallsError') function Farm (options, path) { - this.options = extend(DEFAULT_OPTIONS, options) + this.options = Object.assign({}, DEFAULT_OPTIONS, options) this.path = path this.activeCalls = 0 } @@ -103,7 +103,7 @@ Farm.prototype.onExit = function (childId) { Farm.prototype.startChild = function () { this.childId++ - let forked = fork(this.path) + let forked = fork(this.path, this.options.workerOptions) , id = this.childId , c = { send : forked.send @@ -132,7 +132,7 @@ Farm.prototype.stopChild = function (childId) { setTimeout(function () { if (child.exitCode === null) child.child.kill('SIGKILL') - }, this.options.forcedKillTime) + }, this.options.forcedKillTime).unref() ;delete this.children[childId] this.activeChildren-- } diff --git a/deps/npm/node_modules/worker-farm/lib/fork.js b/deps/npm/node_modules/worker-farm/lib/fork.js index 46cf79b73e..2843df4847 100644 --- a/deps/npm/node_modules/worker-farm/lib/fork.js +++ b/deps/npm/node_modules/worker-farm/lib/fork.js @@ -4,16 +4,17 @@ const childProcess = require('child_process') , childModule = require.resolve('./child/index') -function fork (forkModule) { +function fork (forkModule, workerOptions) { // suppress --debug / --inspect flags while preserving others (like --harmony) let filteredArgs = process.execArgv.filter(function (v) { return !(/^--(debug|inspect)/).test(v) }) - , child = childProcess.fork(childModule, process.argv, { - execArgv: filteredArgs - , env: process.env - , cwd: process.cwd() - }) + , options = Object.assign({ + execArgv : filteredArgs + , env : process.env + , cwd : process.cwd() + }, workerOptions) + , child = childProcess.fork(childModule, process.argv, options) child.on('error', function() { // this *should* be picked up by onExit and the operation requeued diff --git a/deps/npm/node_modules/worker-farm/lib/index.js b/deps/npm/node_modules/worker-farm/lib/index.js index 4df0902f84..fe574e59b5 100644 --- a/deps/npm/node_modules/worker-farm/lib/index.js +++ b/deps/npm/node_modules/worker-farm/lib/index.js @@ -31,4 +31,4 @@ function end (api, callback) { module.exports = farm -module.exports.end = end
\ No newline at end of file +module.exports.end = end diff --git a/deps/npm/node_modules/worker-farm/node_modules/errno/.npmignore b/deps/npm/node_modules/worker-farm/node_modules/errno/.npmignore deleted file mode 100644 index b512c09d47..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/errno/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules
\ No newline at end of file diff --git a/deps/npm/node_modules/worker-farm/node_modules/errno/README.md b/deps/npm/node_modules/worker-farm/node_modules/errno/README.md deleted file mode 100644 index 2c1f8a525d..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/errno/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# node-errno - -Better [libuv](https://github.com/libuv/libuv)/[Node.js](https://nodejs.org)/[io.js](https://iojs.org) error handling & reporting. Available in npm as *errno*. - -* [errno exposed](#errnoexposed) -* [Custom errors](#customerrors) - -<a name="errnoexposed"></a> -## errno exposed - -Ever find yourself needing more details about Node.js errors? Me too, so *node-errno* contains the errno mappings direct from libuv so you can use them in your code. - -**By errno:** - -```js -require('errno').errno[3] -// → { -// "errno": 3, -// "code": "EACCES", -// "description": "permission denied" -// } -``` - -**By code:** - -```js -require('errno').code.ENOTEMPTY -// → { -// "errno": 53, -// "code": "ENOTEMPTY", -// "description": "directory not empty" -// } -``` - -**Make your errors more descriptive:** - -```js -var errno = require('errno') - -function errmsg(err) { - var str = 'Error: ' - // if it's a libuv error then get the description from errno - if (errno.errno[err.errno]) - str += errno.errno[err.errno].description - else - str += err.message - - // if it's a `fs` error then it'll have a 'path' property - if (err.path) - str += ' [' + err.path + ']' - - return str -} - -var fs = require('fs') - -fs.readFile('thisisnotarealfile.txt', function (err, data) { - if (err) - console.log(errmsg(err)) -}) -``` - -**Use as a command line tool:** - -``` -~ $ errno 53 -{ - "errno": 53, - "code": "ENOTEMPTY", - "description": "directory not empty" -} -~ $ errno EROFS -{ - "errno": 56, - "code": "EROFS", - "description": "read-only file system" -} -~ $ errno foo -No such errno/code: "foo" -``` - -Supply no arguments for the full list. Error codes are processed case-insensitive. - -You will need to install with `npm install errno -g` if you want the `errno` command to be available without supplying a full path to the node_modules installation. - -<a name="customerrors"></a> -## Custom errors - -Use `errno.custom.createError()` to create custom `Error` objects to throw around in your Node.js library. Create error heirachies so `instanceof` becomes a useful tool in tracking errors. Call-stack is correctly captured at the time you create an instance of the error object, plus a `cause` property will make available the original error object if you pass one in to the constructor. - -```js -var create = require('errno').custom.createError -var MyError = create('MyError') // inherits from Error -var SpecificError = create('SpecificError', MyError) // inherits from MyError -var OtherError = create('OtherError', MyError) - -// use them! -if (condition) throw new SpecificError('Eeek! Something bad happened') - -if (err) return callback(new OtherError(err)) -``` - -Also available is a `errno.custom.FilesystemError` with in-built access to errno properties: - -```js -fs.readFile('foo', function (err, data) { - if (err) return callback(new errno.custom.FilesystemError(err)) - // do something else -}) -``` - -The resulting error object passed through the callback will have the following properties: `code`, `errno`, `path` and `message` will contain a descriptive human-readable message. - -## Contributors - -* [bahamas10](https://github.com/bahamas10) (Dave Eddy) - Added CLI -* [ralphtheninja](https://github.com/ralphtheninja) (Lars-Magnus Skog) - -## Copyright & Licence - -*Copyright (c) 2012-2015 [Rod Vagg](https://github.com/rvagg) ([@rvagg](https://twitter.com/rvagg))* - -Made available under the MIT licence: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE.
\ No newline at end of file diff --git a/deps/npm/node_modules/worker-farm/node_modules/errno/build.js b/deps/npm/node_modules/worker-farm/node_modules/errno/build.js deleted file mode 100755 index fce89260c1..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/errno/build.js +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env node - -var request = require('request') - , fs = require('fs') - - , uvheadloc = 'https://raw.github.com/joyent/libuv/master/include/uv.h' - , defreg = /^\s*XX\(\s*([\-\d]+),\s*([A-Z]+),\s*"([^"]*)"\s*\)\s*\\?$/ - - -request(uvheadloc, function (err, response) { - if (err) - throw err - - var data, out - - data = response.body - .split('\n') - .map(function (line) { return line.match(defreg) }) - .filter(function (match) { return match }) - .map(function (match) { return { - errno: parseInt(match[1], 10) - , code: match[2] - , description: match[3] - }}) - - out = 'var all = module.exports.all = ' + JSON.stringify(data, 0, 1) + '\n\n' - - out += '\nmodule.exports.errno = {\n ' - + data.map(function (e, i) { - return '\'' + e.errno + '\': all[' + i + ']' - }).join('\n , ') - + '\n}\n\n' - - out += '\nmodule.exports.code = {\n ' - + data.map(function (e, i) { - return '\'' + e.code + '\': all[' + i + ']' - }).join('\n , ') - + '\n}\n\n' - - out += '\nmodule.exports.custom = require("./custom")(module.exports)\n' - - fs.writeFile('errno.js', out) -})
\ No newline at end of file diff --git a/deps/npm/node_modules/worker-farm/node_modules/errno/cli.js b/deps/npm/node_modules/worker-farm/node_modules/errno/cli.js deleted file mode 100755 index f841771b8a..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/errno/cli.js +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env node - -var errno = require('./') - , arg = process.argv[2] - , data, code - -if (arg === undefined) - return console.log(JSON.stringify(errno.code, null, 2)) - -if ((code = +arg) == arg) - data = errno.errno[code] -else - data = errno.code[arg] || errno.code[arg.toUpperCase()] - -if (data) - console.log(JSON.stringify(data, null, 2)) -else { - console.error('No such errno/code: "' + arg + '"') - process.exit(1) -}
\ No newline at end of file diff --git a/deps/npm/node_modules/worker-farm/node_modules/errno/custom.js b/deps/npm/node_modules/worker-farm/node_modules/errno/custom.js deleted file mode 100644 index 7be16c1e4d..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/errno/custom.js +++ /dev/null @@ -1,55 +0,0 @@ -var prr = require('prr') - -function init (type, message, cause) { - prr(this, { - type : type - , name : type - // can be passed just a 'cause' - , cause : typeof message != 'string' ? message : cause - , message : !!message && typeof message != 'string' ? message.message : message - - }, 'ewr') -} - -// generic prototype, not intended to be actually used - helpful for `instanceof` -function CustomError (message, cause) { - Error.call(this) - if (Error.captureStackTrace) - Error.captureStackTrace(this, arguments.callee) - init.call(this, 'CustomError', message, cause) -} - -CustomError.prototype = new Error() - -function createError (errno, type, proto) { - var err = function (message, cause) { - init.call(this, type, message, cause) - //TODO: the specificity here is stupid, errno should be available everywhere - if (type == 'FilesystemError') { - this.code = this.cause.code - this.path = this.cause.path - this.errno = this.cause.errno - this.message = - (errno.errno[this.cause.errno] - ? errno.errno[this.cause.errno].description - : this.cause.message) - + (this.cause.path ? ' [' + this.cause.path + ']' : '') - } - Error.call(this) - if (Error.captureStackTrace) - Error.captureStackTrace(this, arguments.callee) - } - err.prototype = !!proto ? new proto() : new CustomError() - return err -} - -module.exports = function (errno) { - var ce = function (type, proto) { - return createError(errno, type, proto) - } - return { - CustomError : CustomError - , FilesystemError : ce('FilesystemError') - , createError : ce - } -} diff --git a/deps/npm/node_modules/worker-farm/node_modules/errno/errno.js b/deps/npm/node_modules/worker-farm/node_modules/errno/errno.js deleted file mode 100644 index efb79d41b1..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/errno/errno.js +++ /dev/null @@ -1,313 +0,0 @@ -var all = module.exports.all = [ - { - errno: -2, - code: 'ENOENT', - description: 'no such file or directory' - }, - { - errno: -1, - code: 'UNKNOWN', - description: 'unknown error' - }, - { - errno: 0, - code: 'OK', - description: 'success' - }, - { - errno: 1, - code: 'EOF', - description: 'end of file' - }, - { - errno: 2, - code: 'EADDRINFO', - description: 'getaddrinfo error' - }, - { - errno: 3, - code: 'EACCES', - description: 'permission denied' - }, - { - errno: 4, - code: 'EAGAIN', - description: 'resource temporarily unavailable' - }, - { - errno: 5, - code: 'EADDRINUSE', - description: 'address already in use' - }, - { - errno: 6, - code: 'EADDRNOTAVAIL', - description: 'address not available' - }, - { - errno: 7, - code: 'EAFNOSUPPORT', - description: 'address family not supported' - }, - { - errno: 8, - code: 'EALREADY', - description: 'connection already in progress' - }, - { - errno: 9, - code: 'EBADF', - description: 'bad file descriptor' - }, - { - errno: 10, - code: 'EBUSY', - description: 'resource busy or locked' - }, - { - errno: 11, - code: 'ECONNABORTED', - description: 'software caused connection abort' - }, - { - errno: 12, - code: 'ECONNREFUSED', - description: 'connection refused' - }, - { - errno: 13, - code: 'ECONNRESET', - description: 'connection reset by peer' - }, - { - errno: 14, - code: 'EDESTADDRREQ', - description: 'destination address required' - }, - { - errno: 15, - code: 'EFAULT', - description: 'bad address in system call argument' - }, - { - errno: 16, - code: 'EHOSTUNREACH', - description: 'host is unreachable' - }, - { - errno: 17, - code: 'EINTR', - description: 'interrupted system call' - }, - { - errno: 18, - code: 'EINVAL', - description: 'invalid argument' - }, - { - errno: 19, - code: 'EISCONN', - description: 'socket is already connected' - }, - { - errno: 20, - code: 'EMFILE', - description: 'too many open files' - }, - { - errno: 21, - code: 'EMSGSIZE', - description: 'message too long' - }, - { - errno: 22, - code: 'ENETDOWN', - description: 'network is down' - }, - { - errno: 23, - code: 'ENETUNREACH', - description: 'network is unreachable' - }, - { - errno: 24, - code: 'ENFILE', - description: 'file table overflow' - }, - { - errno: 25, - code: 'ENOBUFS', - description: 'no buffer space available' - }, - { - errno: 26, - code: 'ENOMEM', - description: 'not enough memory' - }, - { - errno: 27, - code: 'ENOTDIR', - description: 'not a directory' - }, - { - errno: 28, - code: 'EISDIR', - description: 'illegal operation on a directory' - }, - { - errno: 29, - code: 'ENONET', - description: 'machine is not on the network' - }, - { - errno: 31, - code: 'ENOTCONN', - description: 'socket is not connected' - }, - { - errno: 32, - code: 'ENOTSOCK', - description: 'socket operation on non-socket' - }, - { - errno: 33, - code: 'ENOTSUP', - description: 'operation not supported on socket' - }, - { - errno: 34, - code: 'ENOENT', - description: 'no such file or directory' - }, - { - errno: 35, - code: 'ENOSYS', - description: 'function not implemented' - }, - { - errno: 36, - code: 'EPIPE', - description: 'broken pipe' - }, - { - errno: 37, - code: 'EPROTO', - description: 'protocol error' - }, - { - errno: 38, - code: 'EPROTONOSUPPORT', - description: 'protocol not supported' - }, - { - errno: 39, - code: 'EPROTOTYPE', - description: 'protocol wrong type for socket' - }, - { - errno: 40, - code: 'ETIMEDOUT', - description: 'connection timed out' - }, - { - errno: 41, - code: 'ECHARSET', - description: 'invalid Unicode character' - }, - { - errno: 42, - code: 'EAIFAMNOSUPPORT', - description: 'address family for hostname not supported' - }, - { - errno: 44, - code: 'EAISERVICE', - description: 'servname not supported for ai_socktype' - }, - { - errno: 45, - code: 'EAISOCKTYPE', - description: 'ai_socktype not supported' - }, - { - errno: 46, - code: 'ESHUTDOWN', - description: 'cannot send after transport endpoint shutdown' - }, - { - errno: 47, - code: 'EEXIST', - description: 'file already exists' - }, - { - errno: 48, - code: 'ESRCH', - description: 'no such process' - }, - { - errno: 49, - code: 'ENAMETOOLONG', - description: 'name too long' - }, - { - errno: 50, - code: 'EPERM', - description: 'operation not permitted' - }, - { - errno: 51, - code: 'ELOOP', - description: 'too many symbolic links encountered' - }, - { - errno: 52, - code: 'EXDEV', - description: 'cross-device link not permitted' - }, - { - errno: 53, - code: 'ENOTEMPTY', - description: 'directory not empty' - }, - { - errno: 54, - code: 'ENOSPC', - description: 'no space left on device' - }, - { - errno: 55, - code: 'EIO', - description: 'i/o error' - }, - { - errno: 56, - code: 'EROFS', - description: 'read-only file system' - }, - { - errno: 57, - code: 'ENODEV', - description: 'no such device' - }, - { - errno: 58, - code: 'ESPIPE', - description: 'invalid seek' - }, - { - errno: 59, - code: 'ECANCELED', - description: 'operation canceled' - } -] - -module.exports.errno = {} -module.exports.code = {} - -all.forEach(function (error) { - module.exports.errno[error.errno] = error - module.exports.code[error.code] = error -}) - -module.exports.custom = require('./custom')(module.exports) -module.exports.create = module.exports.custom.createError diff --git a/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/.npmignore b/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/.npmignore deleted file mode 100644 index b512c09d47..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules
\ No newline at end of file diff --git a/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/.travis.yml b/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/.travis.yml deleted file mode 100644 index fe3f4eb153..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: node_js -node_js: - - 0.8 - - "0.10" -branches: - only: - - master -notifications: - email: - - rod@vagg.org diff --git a/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/LICENSE b/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/LICENSE deleted file mode 100644 index f6a0029de1..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/LICENSE +++ /dev/null @@ -1,39 +0,0 @@ -Copyright 2013, Rod Vagg (the "Original Author") -All rights reserved. - -MIT +no-false-attribs License - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -Distributions of all or part of the Software intended to be used -by the recipients as they would use the unmodified Software, -containing modifications that substantially alter, remove, or -disable functionality of the Software, outside of the documented -configuration mechanisms provided by the Software, shall be -modified such that the Original Author's bug reporting email -addresses and urls are either replaced with the contact information -of the parties responsible for the changes, or removed entirely. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - - -Except where noted, this license applies to any and all software -programs and associated documentation files created by the -Original Author, when distributed with the Software.
\ No newline at end of file diff --git a/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/README.md b/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/README.md deleted file mode 100644 index 3e709e3bd9..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# prr [](http://travis-ci.org/rvagg/prr) - -An sensible alternative to `Object.defineProperty()`. Available in npm and Ender as **prr**. - -## Usage - -Set the property `'foo'` (`obj.foo`) to have the value `'bar'` with default options (*enumerable, configurable and writable are all false*): - -```js -prr(obj, 'foo', 'bar') -``` - -Adjust the default options: - -```js -prr(obj, 'foo', 'bar', { enumerable: true, writable: true }) -``` - -Do the same operation for multiple properties: - -```js -prr(obj, { one: 'one', two: 'two' }) -// or with options: -prr(obj, { one: 'one', two: 'two' }, { enumerable: true, writable: true }) -``` - -But obviously, having to write out the full options object makes it nearly as bad as the original `Object.defineProperty()` so we can **simplify**. - -As an alternative method we can use an options string where each character represents a option: `'e'=='enumerable'`, `'c'=='configurable'` and `'w'=='writable'`: - -```js -prr(obj, 'foo', 'bar', 'ew') // enumerable and writable but not configurable -// muliple properties: -prr(obj, { one: 'one', two: 'two' }, 'ewc') // configurable too -``` - -## Where can I use it? - -Anywhere! For pre-ES5 environments *prr* will simply fall-back to an `object[property] = value` so you can get close to what you want. - -*prr* is Ender-compatible so you can include it in your Ender build and `$.prr(...)` or `var prr = require('prr'); prr(...)`. - -## Licence - -prr is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licensed under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.
\ No newline at end of file diff --git a/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/package.json b/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/package.json deleted file mode 100644 index 4af59e2e92..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_from": "prr@~0.0.0", - "_id": "prr@0.0.0", - "_inBundle": false, - "_integrity": "sha1-GoS4WQgyVQFBGFPQCB7j+obikmo=", - "_location": "/worker-farm/errno/prr", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "prr@~0.0.0", - "name": "prr", - "escapedName": "prr", - "rawSpec": "~0.0.0", - "saveSpec": null, - "fetchSpec": "~0.0.0" - }, - "_requiredBy": [ - "/worker-farm/errno" - ], - "_resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz", - "_shasum": "1a84b85908325501411853d0081ee3fa86e2926a", - "_spec": "prr@~0.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/worker-farm/node_modules/errno", - "authors": [ - "Rod Vagg <rod@vagg.org> (https://github.com/rvagg)" - ], - "bugs": { - "url": "https://github.com/rvagg/prr/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "A better Object.defineProperty()", - "devDependencies": { - "tap": "*" - }, - "homepage": "https://github.com/rvagg/prr", - "keywords": [ - "property", - "properties", - "defineProperty", - "ender" - ], - "license": "MIT", - "main": "./prr.js", - "name": "prr", - "repository": { - "type": "git", - "url": "git+https://github.com/rvagg/prr.git" - }, - "scripts": { - "test": "node ./test.js" - }, - "version": "0.0.0" -} diff --git a/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/prr.js b/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/prr.js deleted file mode 100644 index 94f58628be..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/prr.js +++ /dev/null @@ -1,63 +0,0 @@ -/*! - * prr - * (c) 2013 Rod Vagg <rod@vagg.org> - * https://github.com/rvagg/prr - * License: MIT - */ - -(function (name, context, definition) { - if (typeof module != 'undefined' && module.exports) - module.exports = definition() - else - context[name] = definition() -})('prr', this, function() { - - var setProperty = typeof Object.defineProperty == 'function' - ? function (obj, key, options) { - Object.defineProperty(obj, key, options) - return obj - } - : function (obj, key, options) { // < es5 - obj[key] = options.value - return obj - } - - , makeOptions = function (value, options) { - var oo = typeof options == 'object' - , os = !oo && typeof options == 'string' - , op = function (p) { - return oo - ? !!options[p] - : os - ? options.indexOf(p[0]) > -1 - : false - } - - return { - enumerable : op('enumerable') - , configurable : op('configurable') - , writable : op('writable') - , value : value - } - } - - , prr = function (obj, key, value, options) { - var k - - options = makeOptions(value, options) - - if (typeof key == 'object') { - for (k in key) { - if (Object.hasOwnProperty.call(key, k)) { - options.value = key[k] - setProperty(obj, k, options) - } - } - return obj - } - - return setProperty(obj, key, options) - } - - return prr -})
\ No newline at end of file diff --git a/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/test.js b/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/test.js deleted file mode 100644 index 5222e3073c..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/errno/node_modules/prr/test.js +++ /dev/null @@ -1,169 +0,0 @@ -const test = require('tap').test - , prr = require('./') - -test('test prr(o, key, value) form', function (t) { - t.plan(2) - - var o = {} - prr(o, 'foo', 'bar') - t.equal(o.foo, 'bar', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo') - , { - enumerable : false - , configurable : false - , writable : false - , value : 'bar' - } - , 'correct property descriptor' - ) - t.end() -}) - -test('test prr(o, { key: value }) form', function (t) { - t.plan(2) - - var o = {} - prr(o, { foo: 'bar' }) - - t.equal(o.foo, 'bar', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo') - , { - enumerable : false - , configurable : false - , writable : false - , value : 'bar' - } - , 'correct property descriptor' - ) - t.end() -}) - -test('test multiple key:value pairs', function (t) { - var o = { foo: 'bar' } - - prr(o, { one: 'ONE', two: 'TWO', obj: { o: 'o' }}) - - t.deepEqual(o, { foo: 'bar' }, 'properties are not enumerable') - t.equal(o.one, 'ONE', 'correctly set property') - t.equal(o.two, 'TWO', 'correctly set property') - t.deepEqual(o.obj, { o: 'o' }, 'correctly set property') - - ;[ 'one', 'two', 'obj' ].forEach(function (p) { - t.deepEqual( - Object.getOwnPropertyDescriptor(o, p) - , { - enumerable : false - , configurable : false - , writable : false - , value : p == 'obj' ? { o: 'o' } : p.toUpperCase() - } - , 'correct property descriptor' - ) - }) - - t.end() -}) - -test('test descriptor options', function (t) { - var o = {} - - prr(o, 'foo', 'bar', { - enumerable : true - , configurable : false - }) - t.equal(o.foo, 'bar', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo') - , { - enumerable : true - , configurable : false - , writable : false - , value : 'bar' - } - , 'correct property descriptor' - ) - - prr(o, 'foo2', 'bar2', { - enumerable : true - , configurable : true - , writable : false - }) - t.equal(o.foo2, 'bar2', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo2') - , { - enumerable : true - , configurable : true - , writable : false - , value : 'bar2' - } - , 'correct property descriptor' - ) - - prr(o, 'foo3', 'bar3', { - enumerable : true - , configurable : true - , writable : true - }) - t.equal(o.foo3, 'bar3', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo3') - , { - enumerable : true - , configurable : true - , writable : true - , value : 'bar3' - } - , 'correct property descriptor' - ) - - t.end() -}) - - -test('test descriptor options, string form', function (t) { - var o = {} - - prr(o, 'foo', 'bar', 'e') - t.equal(o.foo, 'bar', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo') - , { - enumerable : true - , configurable : false - , writable : false - , value : 'bar' - } - , 'correct property descriptor' - ) - - prr(o, 'foo2', 'bar2', 'ec') - t.equal(o.foo2, 'bar2', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo2') - , { - enumerable : true - , configurable : true - , writable : false - , value : 'bar2' - } - , 'correct property descriptor' - ) - - prr(o, 'foo3', 'bar3', 'ecw') - t.equal(o.foo3, 'bar3', 'correct value') - t.deepEqual( - Object.getOwnPropertyDescriptor(o, 'foo3') - , { - enumerable : true - , configurable : true - , writable : true - , value : 'bar3' - } - , 'correct property descriptor' - ) - - t.end() -}) diff --git a/deps/npm/node_modules/worker-farm/node_modules/errno/package.json b/deps/npm/node_modules/worker-farm/node_modules/errno/package.json deleted file mode 100644 index c0df7f24aa..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/errno/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "_from": "errno@>=0.1.1 <0.2.0-0", - "_id": "errno@0.1.4", - "_inBundle": false, - "_integrity": "sha1-uJbiOp5ei6M4cfyZar02NfyaHH0=", - "_location": "/worker-farm/errno", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "errno@>=0.1.1 <0.2.0-0", - "name": "errno", - "escapedName": "errno", - "rawSpec": ">=0.1.1 <0.2.0-0", - "saveSpec": null, - "fetchSpec": ">=0.1.1 <0.2.0-0" - }, - "_requiredBy": [ - "/worker-farm" - ], - "_resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz", - "_shasum": "b896e23a9e5e8ba33871fc996abd3635fc9a1c7d", - "_spec": "errno@>=0.1.1 <0.2.0-0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/worker-farm", - "authors": [ - "Rod Vagg @rvagg <rod@vagg.org> (https://github.com/rvagg)" - ], - "bin": { - "errno": "./cli.js" - }, - "bugs": { - "url": "https://github.com/rvagg/node-errno/issues" - }, - "bundleDependencies": false, - "dependencies": { - "prr": "~0.0.0" - }, - "deprecated": false, - "description": "libuv errno details exposed", - "devDependencies": { - "tape": "~3.5.0" - }, - "homepage": "https://github.com/rvagg/node-errno#readme", - "keywords": [ - "errors", - "errno", - "libuv" - ], - "license": "MIT", - "main": "errno.js", - "name": "errno", - "repository": { - "type": "git", - "url": "git+https://github.com/rvagg/node-errno.git" - }, - "scripts": { - "test": "tape test.js" - }, - "version": "0.1.4" -} diff --git a/deps/npm/node_modules/worker-farm/node_modules/errno/test.js b/deps/npm/node_modules/worker-farm/node_modules/errno/test.js deleted file mode 100755 index 6b76a85ae1..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/errno/test.js +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env node - -var test = require('tape') - , errno = require('./') - -test('sanity checks', function (t) { - t.ok(errno.all, 'errno.all not found') - t.ok(errno.errno, 'errno.errno not found') - t.ok(errno.code, 'errno.code not found') - - t.equal(errno.all.length, 59, 'found ' + errno.all.length + ', expected 59') - t.equal(errno.errno['-1'], errno.all[0], 'errno -1 not first element') - - t.equal(errno.code['UNKNOWN'], errno.all[0], 'code UNKNOWN not first element') - - t.equal(errno.errno[1], errno.all[2], 'errno 1 not third element') - - t.equal(errno.code['EOF'], errno.all[2], 'code EOF not third element') - t.end() -}) - -test('custom errors', function (t) { - var Cust = errno.create('FooNotBarError') - var cust = new Cust('foo is not bar') - - t.equal(cust.name, 'FooNotBarError', 'correct custom name') - t.equal(cust.type, 'FooNotBarError', 'correct custom type') - t.equal(cust.message, 'foo is not bar', 'correct custom message') - t.notOk(cust.cause, 'no cause') - t.end() -}) diff --git a/deps/npm/node_modules/worker-farm/node_modules/xtend/.npmignore b/deps/npm/node_modules/worker-farm/node_modules/xtend/.npmignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/xtend/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/worker-farm/node_modules/xtend/LICENCE b/deps/npm/node_modules/worker-farm/node_modules/xtend/LICENCE deleted file mode 100644 index 1a14b437e8..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/xtend/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012-2014 Raynos. - -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/npm/node_modules/worker-farm/node_modules/xtend/Makefile b/deps/npm/node_modules/worker-farm/node_modules/xtend/Makefile deleted file mode 100644 index d583fcf49d..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/xtend/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -browser: - node ./support/compile - -.PHONY: browser
\ No newline at end of file diff --git a/deps/npm/node_modules/worker-farm/node_modules/xtend/README.md b/deps/npm/node_modules/worker-farm/node_modules/xtend/README.md deleted file mode 100644 index 093cb2978e..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/xtend/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# xtend - -[![browser support][3]][4] - -[](http://github.com/badges/stability-badges) - -Extend like a boss - -xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence. - -## Examples - -```js -var extend = require("xtend") - -// extend returns a new object. Does not mutate arguments -var combination = extend({ - a: "a", - b: 'c' -}, { - b: "b" -}) -// { a: "a", b: "b" } -``` - -## Stability status: Locked - -## MIT Licenced - - - [3]: http://ci.testling.com/Raynos/xtend.png - [4]: http://ci.testling.com/Raynos/xtend diff --git a/deps/npm/node_modules/worker-farm/node_modules/xtend/immutable.js b/deps/npm/node_modules/worker-farm/node_modules/xtend/immutable.js deleted file mode 100644 index 94889c9de1..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/xtend/immutable.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend() { - var target = {} - - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/deps/npm/node_modules/worker-farm/node_modules/xtend/mutable.js b/deps/npm/node_modules/worker-farm/node_modules/xtend/mutable.js deleted file mode 100644 index 72debede6c..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/xtend/mutable.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/deps/npm/node_modules/worker-farm/node_modules/xtend/package.json b/deps/npm/node_modules/worker-farm/node_modules/xtend/package.json deleted file mode 100644 index 7df1addbac..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/xtend/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "_from": "xtend@>=4.0.0 <4.1.0-0", - "_id": "xtend@4.0.1", - "_inBundle": false, - "_integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "_location": "/worker-farm/xtend", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "xtend@>=4.0.0 <4.1.0-0", - "name": "xtend", - "escapedName": "xtend", - "rawSpec": ">=4.0.0 <4.1.0-0", - "saveSpec": null, - "fetchSpec": ">=4.0.0 <4.1.0-0" - }, - "_requiredBy": [ - "/worker-farm" - ], - "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "_shasum": "a5c6d532be656e23db820efb943a1f04998d63af", - "_shrinkwrap": null, - "_spec": "xtend@>=4.0.0 <4.1.0-0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/worker-farm", - "bin": null, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "[![browser support][3]][4]", - "devDependencies": { - "tape": "~1.1.0" - }, - "engines": { - "node": ">=0.4" - }, - "main": "immutable", - "name": "xtend", - "optionalDependencies": {}, - "peerDependencies": {}, - "scripts": {}, - "version": "4.0.1" -} diff --git a/deps/npm/node_modules/worker-farm/node_modules/xtend/test.js b/deps/npm/node_modules/worker-farm/node_modules/xtend/test.js deleted file mode 100644 index 093a2b061e..0000000000 --- a/deps/npm/node_modules/worker-farm/node_modules/xtend/test.js +++ /dev/null @@ -1,83 +0,0 @@ -var test = require("tape") -var extend = require("./") -var mutableExtend = require("./mutable") - -test("merge", function(assert) { - var a = { a: "foo" } - var b = { b: "bar" } - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("replace", function(assert) { - var a = { a: "foo" } - var b = { a: "bar" } - - assert.deepEqual(extend(a, b), { a: "bar" }) - assert.end() -}) - -test("undefined", function(assert) { - var a = { a: undefined } - var b = { b: "foo" } - - assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) - assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) - assert.end() -}) - -test("handle 0", function(assert) { - var a = { a: "default" } - var b = { a: 0 } - - assert.deepEqual(extend(a, b), { a: 0 }) - assert.deepEqual(extend(b, a), { a: "default" }) - assert.end() -}) - -test("is immutable", function (assert) { - var record = {} - - extend(record, { foo: "bar" }) - assert.equal(record.foo, undefined) - assert.end() -}) - -test("null as argument", function (assert) { - var a = { foo: "bar" } - var b = null - var c = void 0 - - assert.deepEqual(extend(b, a, c), { foo: "bar" }) - assert.end() -}) - -test("mutable", function (assert) { - var a = { foo: "bar" } - - mutableExtend(a, { bar: "baz" }) - - assert.equal(a.bar, "baz") - assert.end() -}) - -test("null prototype", function(assert) { - var a = { a: "foo" } - var b = Object.create(null) - b.b = "bar"; - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("null prototype mutable", function (assert) { - var a = { foo: "bar" } - var b = Object.create(null) - b.bar = "baz"; - - mutableExtend(a, b) - - assert.equal(a.bar, "baz") - assert.end() -}) diff --git a/deps/npm/node_modules/worker-farm/package.json b/deps/npm/node_modules/worker-farm/package.json index d60f581cff..ba43c44d4b 100644 --- a/deps/npm/node_modules/worker-farm/package.json +++ b/deps/npm/node_modules/worker-farm/package.json @@ -1,43 +1,45 @@ { - "_from": "worker-farm@1.5.1", - "_id": "worker-farm@1.5.1", + "_args": [ + [ + "worker-farm@1.6.0", + "/Users/rebecca/code/npm" + ] + ], + "_from": "worker-farm@1.6.0", + "_id": "worker-farm@1.6.0", "_inBundle": false, - "_integrity": "sha512-T5NH6Wqsd8MwGD4AK8BBllUy6LmHaqjEOyo/YIUEegZui6/v5Bqde//3jwyE3PGiGYMmWi06exFBi5LNhhPFNw==", + "_integrity": "sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ==", "_location": "/worker-farm", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "worker-farm@1.5.1", + "raw": "worker-farm@1.6.0", "name": "worker-farm", "escapedName": "worker-farm", - "rawSpec": "1.5.1", + "rawSpec": "1.6.0", "saveSpec": null, - "fetchSpec": "1.5.1" + "fetchSpec": "1.6.0" }, "_requiredBy": [ - "#USER", - "/" + "/", + "/libcipm" ], - "_resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.5.1.tgz", - "_shasum": "8e9f4a7da4f3c595aa600903051b969390423fa1", - "_spec": "worker-farm@1.5.1", - "_where": "/Users/zkat/Documents/code/npm", + "_resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz", + "_spec": "1.6.0", + "_where": "/Users/rebecca/code/npm", "authors": [ "Rod Vagg @rvagg <rod@vagg.org> (https://github.com/rvagg)" ], "bugs": { "url": "https://github.com/rvagg/node-worker-farm/issues" }, - "bundleDependencies": false, "dependencies": { - "errno": "^0.1.4", - "xtend": "^4.0.1" + "errno": "~0.1.7" }, - "deprecated": false, "description": "Distribute processing tasks to child processes with an über-simple API and baked-in durability & custom concurrency options.", "devDependencies": { - "tape": "^4.7.0" + "tape": "~4.9.0" }, "homepage": "https://github.com/rvagg/node-worker-farm", "keywords": [ @@ -57,5 +59,5 @@ "test": "node ./tests/" }, "types": "./index.d.ts", - "version": "1.5.1" + "version": "1.6.0" } diff --git a/deps/npm/node_modules/worker-farm/tests/child.js b/deps/npm/node_modules/worker-farm/tests/child.js new file mode 100644 index 0000000000..71cb728f77 --- /dev/null +++ b/deps/npm/node_modules/worker-farm/tests/child.js @@ -0,0 +1,87 @@ +'use strict' + +const fs = require('fs') +const started = Date.now() + + +module.exports = function (timeout, callback) { + callback = callback.bind(null, null, process.pid, Math.random(), timeout) + if (timeout) + return setTimeout(callback, timeout) + callback() +} + + +module.exports.args = function (callback) { + callback(null, { + argv : process.argv + , cwd : process.cwd() + , execArgv : process.execArgv + }) +} + + +module.exports.run0 = function (callback) { + module.exports(0, callback) +} + + +module.exports.killable = function (id, callback) { + if (Math.random() < 0.5) + return process.exit(-1) + callback(null, id, process.pid) +} + + +module.exports.err = function (type, message, data, callback) { + if (typeof data == 'function') { + callback = data + data = null + } else { + let err = new Error(message) + Object.keys(data).forEach(function(key) { + err[key] = data[key] + }) + callback(err) + return + } + + if (type == 'TypeError') + return callback(new TypeError(message)) + callback(new Error(message)) +} + + +module.exports.block = function () { + while (true); +} + + +// use provided file path to save retries count among terminated workers +module.exports.stubborn = function (path, callback) { + function isOutdated(path) { + return ((new Date).getTime() - fs.statSync(path).mtime.getTime()) > 2000 + } + + // file may not be properly deleted, check if modified no earler than two seconds ago + if (!fs.existsSync(path) || isOutdated(path)) { + fs.writeFileSync(path, '1') + process.exit(-1) + } + + let retry = parseInt(fs.readFileSync(path, 'utf8')) + if (Number.isNaN(retry)) + return callback(new Error('file contents is not a number')) + + if (retry > 4) { + callback(null, 12) + } else { + fs.writeFileSync(path, String(retry + 1)) + process.exit(-1) + } +} + + +module.exports.uptime = function (callback) { + callback(null, Date.now() - started) +} diff --git a/deps/npm/node_modules/worker-farm/tests/debug.js b/deps/npm/node_modules/worker-farm/tests/debug.js new file mode 100644 index 0000000000..4d2b803216 --- /dev/null +++ b/deps/npm/node_modules/worker-farm/tests/debug.js @@ -0,0 +1,12 @@ +'use strict' + +const workerFarm = require('../') + , workers = workerFarm(require.resolve('./child'), ['args']) + + +workers.args(function(err, result) { + console.log(result); + workerFarm.end(workers) + console.log('FINISHED') + process.exit(0) +}) diff --git a/deps/npm/node_modules/worker-farm/tests/index.js b/deps/npm/node_modules/worker-farm/tests/index.js new file mode 100644 index 0000000000..ec9deabedd --- /dev/null +++ b/deps/npm/node_modules/worker-farm/tests/index.js @@ -0,0 +1,564 @@ +'use strict' + +const tape = require('tape') + , child_process = require('child_process') + , workerFarm = require('../') + , childPath = require.resolve('./child') + , fs = require('fs') + , os = require('os') + +function uniq (ar) { + let a = [], i, j + o: for (i = 0; i < ar.length; ++i) { + for (j = 0; j < a.length; ++j) if (a[j] == ar[i]) continue o + a[a.length] = ar[i] + } + return a +} + + +// a child where module.exports = function ... +tape('simple, exports=function test', function (t) { + t.plan(4) + + let child = workerFarm(childPath) + child(0, function (err, pid, rnd) { + t.ok(pid > process.pid, 'pid makes sense') + t.ok(pid < process.pid + 750, 'pid makes sense') + t.ok(rnd >= 0 && rnd < 1, 'rnd result makes sense') + }) + + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) +}) + + +// a child where we have module.exports.fn = function ... +tape('simple, exports.fn test', function (t) { + t.plan(4) + + let child = workerFarm(childPath, [ 'run0' ]) + child.run0(function (err, pid, rnd) { + t.ok(pid > process.pid, 'pid makes sense') + t.ok(pid < process.pid + 750, 'pid makes sense') + t.ok(rnd >= 0 && rnd < 1, 'rnd result makes sense') + }) + + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) +}) + + +// use the returned pids to check that we're using a single child process +// when maxConcurrentWorkers = 1 +tape('single worker', function (t) { + t.plan(2) + + let child = workerFarm({ maxConcurrentWorkers: 1 }, childPath) + , pids = [] + , i = 10 + + while (i--) { + child(0, function (err, pid) { + pids.push(pid) + if (pids.length == 10) { + t.equal(1, uniq(pids).length, 'only a single process (by pid)') + } else if (pids.length > 10) + t.fail('too many callbacks!') + }) + } + + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) +}) + + +// use the returned pids to check that we're using two child processes +// when maxConcurrentWorkers = 2 +tape('two workers', function (t) { + t.plan(2) + + let child = workerFarm({ maxConcurrentWorkers: 2 }, childPath) + , pids = [] + , i = 10 + + while (i--) { + child(0, function (err, pid) { + pids.push(pid) + if (pids.length == 10) { + t.equal(2, uniq(pids).length, 'only two child processes (by pid)') + } else if (pids.length > 10) + t.fail('too many callbacks!') + }) + } + + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) +}) + + +// use the returned pids to check that we're using a child process per +// call when maxConcurrentWorkers = 10 +tape('many workers', function (t) { + t.plan(2) + + let child = workerFarm({ maxConcurrentWorkers: 10 }, childPath) + , pids = [] + , i = 10 + + while (i--) { + child(1, function (err, pid) { + pids.push(pid) + if (pids.length == 10) { + t.equal(10, uniq(pids).length, 'pids are all the same (by pid)') + } else if (pids.length > 10) + t.fail('too many callbacks!') + }) + } + + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) +}) + + +tape('auto start workers', function (t) { + let child = workerFarm({ maxConcurrentWorkers: 3, autoStart: true }, childPath, ['uptime']) + , pids = [] + , count = 5 + , i = count + , delay = 250 + + t.plan(count + 1) + + setTimeout(function() { + while (i--) + child.uptime(function (err, uptime) { + t.ok(uptime > 10, 'child has been up before the request (' + uptime + 'ms)') + }) + + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) + }, delay) +}) + + +// use the returned pids to check that we're using a child process per +// call when we set maxCallsPerWorker = 1 even when we have maxConcurrentWorkers = 1 +tape('single call per worker', function (t) { + t.plan(2) + + let child = workerFarm({ + maxConcurrentWorkers: 1 + , maxConcurrentCallsPerWorker: Infinity + , maxCallsPerWorker: 1 + , autoStart: true + }, childPath) + , pids = [] + , count = 25 + , i = count + + while (i--) { + child(0, function (err, pid) { + pids.push(pid) + if (pids.length == count) { + t.equal(count, uniq(pids).length, 'one process for each call (by pid)') + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) + } else if (pids.length > count) + t.fail('too many callbacks!') + }) + } +}) + + +// use the returned pids to check that we're using a child process per +// two-calls when we set maxCallsPerWorker = 2 even when we have maxConcurrentWorkers = 1 +tape('two calls per worker', function (t) { + t.plan(2) + + let child = workerFarm({ + maxConcurrentWorkers: 1 + , maxConcurrentCallsPerWorker: Infinity + , maxCallsPerWorker: 2 + , autoStart: true + }, childPath) + , pids = [] + , count = 20 + , i = count + + while (i--) { + child(0, function (err, pid) { + pids.push(pid) + if (pids.length == count) { + t.equal(count / 2, uniq(pids).length, 'one process for each call (by pid)') + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) + } else if (pids.length > count) + t.fail('too many callbacks!') + }) + } +}) + + +// use timing to confirm that one worker will process calls sequentially +tape('many concurrent calls', function (t) { + t.plan(2) + + let child = workerFarm({ + maxConcurrentWorkers: 1 + , maxConcurrentCallsPerWorker: Infinity + , maxCallsPerWorker: Infinity + , autoStart: true + }, childPath) + , defer = 200 + , count = 200 + , i = count + , cbc = 0 + + setTimeout(function () { + let start = Date.now() + + while (i--) { + child(defer, function () { + if (++cbc == count) { + let time = Date.now() - start + // upper-limit not tied to `count` at all + t.ok(time > defer && time < (defer * 2.5), 'processed tasks concurrently (' + time + 'ms)') + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) + } else if (cbc > count) + t.fail('too many callbacks!') + }) + } + }, 250) +}) + + +// use timing to confirm that one child processes calls sequentially with +// maxConcurrentCallsPerWorker = 1 +tape('single concurrent call', function (t) { + t.plan(2) + + let child = workerFarm({ + maxConcurrentWorkers: 1 + , maxConcurrentCallsPerWorker: 1 + , maxCallsPerWorker: Infinity + , autoStart: true + }, childPath) + , defer = 20 + , count = 100 + , i = count + , cbc = 0 + + setTimeout(function () { + let start = Date.now() + + while (i--) { + child(defer, function () { + if (++cbc == count) { + let time = Date.now() - start + // upper-limit tied closely to `count`, 1.3 is generous but accounts for all the timers + // coming back at the same time and the IPC overhead + t.ok(time > (defer * count) && time < (defer * count * 1.3), 'processed tasks sequentially (' + time + ')') + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) + } else if (cbc > count) + t.fail('too many callbacks!') + }) + } + }, 250) +}) + + +// use timing to confirm that one child processes *only* 5 calls concurrently +tape('multiple concurrent calls', function (t) { + t.plan(2) + + let callsPerWorker = 5 + , child = workerFarm({ + maxConcurrentWorkers: 1 + , maxConcurrentCallsPerWorker: callsPerWorker + , maxCallsPerWorker: Infinity + , autoStart: true + }, childPath) + , defer = 100 + , count = 100 + , i = count + , cbc = 0 + + setTimeout(function () { + let start = Date.now() + + while (i--) { + child(defer, function () { + if (++cbc == count) { + let time = Date.now() - start + // (defer * (count / callsPerWorker + 1)) - if precise it'd be count/callsPerWorker + // but accounting for IPC and other overhead, we need to give it a bit of extra time, + // hence the +1 + t.ok(time > (defer * 1.5) && time < (defer * (count / callsPerWorker + 1)), 'processed tasks concurrently (' + time + 'ms)') + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) + } else if (cbc > count) + t.fail('too many callbacks!') + }) + } + }, 250) +}) + + +// call a method that will die with a probability of 0.5 but expect that +// we'll get results for each of our calls anyway +tape('durability', function (t) { + t.plan(3) + + let child = workerFarm({ maxConcurrentWorkers: 2 }, childPath, [ 'killable' ]) + , ids = [] + , pids = [] + , count = 20 + , i = count + + while (i--) { + child.killable(i, function (err, id, pid) { + ids.push(id) + pids.push(pid) + if (ids.length == count) { + t.ok(uniq(pids).length > 2, 'processed by many (' + uniq(pids).length + ') workers, but got there in the end!') + t.ok(uniq(ids).length == count, 'received a single result for each unique call') + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) + } else if (ids.length > count) + t.fail('too many callbacks!') + }) + } +}) + + +// a callback provided to .end() can and will be called (uses "simple, exports=function test" to create a child) +tape('simple, end callback', function (t) { + t.plan(4) + + let child = workerFarm(childPath) + child(0, function (err, pid, rnd) { + t.ok(pid > process.pid, 'pid makes sense ' + pid + ' vs ' + process.pid) + t.ok(pid < process.pid + 750, 'pid makes sense ' + pid + ' vs ' + process.pid) + t.ok(rnd >= 0 && rnd < 1, 'rnd result makes sense') + }) + + workerFarm.end(child, function() { + t.pass('an .end() callback was successfully called') + }) +}) + + +tape('call timeout test', function (t) { + t.plan(3 + 3 + 4 + 4 + 4 + 3 + 1) + + let child = workerFarm({ maxCallTime: 250, maxConcurrentWorkers: 1 }, childPath) + + // should come back ok + child(50, function (err, pid, rnd) { + t.ok(pid > process.pid, 'pid makes sense ' + pid + ' vs ' + process.pid) + t.ok(pid < process.pid + 750, 'pid makes sense ' + pid + ' vs ' + process.pid) + t.ok(rnd > 0 && rnd < 1, 'rnd result makes sense ' + rnd) + }) + + // should come back ok + child(50, function (err, pid, rnd) { + t.ok(pid > process.pid, 'pid makes sense ' + pid + ' vs ' + process.pid) + t.ok(pid < process.pid + 750, 'pid makes sense ' + pid + ' vs ' + process.pid) + t.ok(rnd > 0 && rnd < 1, 'rnd result makes sense ' + rnd) + }) + + // should die + child(500, function (err, pid, rnd) { + t.ok(err, 'got an error') + t.equal(err.type, 'TimeoutError', 'correct error type') + t.ok(pid === undefined, 'no pid') + t.ok(rnd === undefined, 'no rnd') + }) + + // should die + child(1000, function (err, pid, rnd) { + t.ok(err, 'got an error') + t.equal(err.type, 'TimeoutError', 'correct error type') + t.ok(pid === undefined, 'no pid') + t.ok(rnd === undefined, 'no rnd') + }) + + // should die even though it is only a 100ms task, it'll get caught up + // in a dying worker + setTimeout(function () { + child(100, function (err, pid, rnd) { + t.ok(err, 'got an error') + t.equal(err.type, 'TimeoutError', 'correct error type') + t.ok(pid === undefined, 'no pid') + t.ok(rnd === undefined, 'no rnd') + }) + }, 200) + + // should be ok, new worker + setTimeout(function () { + child(50, function (err, pid, rnd) { + t.ok(pid > process.pid, 'pid makes sense ' + pid + ' vs ' + process.pid) + t.ok(pid < process.pid + 750, 'pid makes sense ' + pid + ' vs ' + process.pid) + t.ok(rnd > 0 && rnd < 1, 'rnd result makes sense ' + rnd) + }) + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) + }, 400) +}) + + +tape('test error passing', function (t) { + t.plan(10) + + let child = workerFarm(childPath, [ 'err' ]) + child.err('Error', 'this is an Error', function (err) { + t.ok(err instanceof Error, 'is an Error object') + t.equal('Error', err.type, 'correct type') + t.equal('this is an Error', err.message, 'correct message') + }) + child.err('TypeError', 'this is a TypeError', function (err) { + t.ok(err instanceof Error, 'is a TypeError object') + t.equal('TypeError', err.type, 'correct type') + t.equal('this is a TypeError', err.message, 'correct message') + }) + child.err('Error', 'this is an Error with custom props', {foo: 'bar', 'baz': 1}, function (err) { + t.ok(err instanceof Error, 'is an Error object') + t.equal(err.foo, 'bar', 'passes data') + t.equal(err.baz, 1, 'passes data') + }) + + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) +}) + + +tape('test maxConcurrentCalls', function (t) { + t.plan(10) + + let child = workerFarm({ maxConcurrentCalls: 5 }, childPath) + + child(50, function (err) { t.notOk(err, 'no error') }) + child(50, function (err) { t.notOk(err, 'no error') }) + child(50, function (err) { t.notOk(err, 'no error') }) + child(50, function (err) { t.notOk(err, 'no error') }) + child(50, function (err) { t.notOk(err, 'no error') }) + child(50, function (err) { + t.ok(err) + t.equal(err.type, 'MaxConcurrentCallsError', 'correct error type') + }) + child(50, function (err) { + t.ok(err) + t.equal(err.type, 'MaxConcurrentCallsError', 'correct error type') + }) + + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) +}) + + +// this test should not keep the process running! if the test process +// doesn't die then the problem is here +tape('test timeout kill', function (t) { + t.plan(3) + + let child = workerFarm({ maxCallTime: 250, maxConcurrentWorkers: 1 }, childPath, [ 'block' ]) + child.block(function (err) { + t.ok(err, 'got an error') + t.equal(err.type, 'TimeoutError', 'correct error type') + }) + + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) +}) + + +tape('test max retries after process terminate', function (t) { + t.plan(7) + + // temporary file is used to store the number of retries among terminating workers + let filepath1 = '.retries1' + let child1 = workerFarm({ maxConcurrentWorkers: 1, maxRetries: 5}, childPath, [ 'stubborn' ]) + child1.stubborn(filepath1, function (err, result) { + t.notOk(err, 'no error') + t.equal(result, 12, 'correct result') + }) + + workerFarm.end(child1, function () { + fs.unlinkSync(filepath1) + t.ok(true, 'workerFarm ended') + }) + + let filepath2 = '.retries2' + let child2 = workerFarm({ maxConcurrentWorkers: 1, maxRetries: 3}, childPath, [ 'stubborn' ]) + child2.stubborn(filepath2, function (err, result) { + t.ok(err, 'got an error') + t.equal(err.type, 'ProcessTerminatedError', 'correct error type') + t.equal(err.message, 'cancel after 3 retries!', 'correct message and number of retries') + }) + + workerFarm.end(child2, function () { + fs.unlinkSync(filepath2) + t.ok(true, 'workerFarm ended') + }) +}) + + +tape('custom arguments can be passed to "fork"', function (t) { + t.plan(3) + + // allocate a real, valid path, in any OS + let cwd = fs.realpathSync(os.tmpdir()) + , workerOptions = { + cwd : cwd + , execArgv : ['--no-warnings'] + } + , child = workerFarm({ maxConcurrentWorkers: 1, maxRetries: 5, workerOptions: workerOptions}, childPath, ['args']) + + child.args(function (err, result) { + t.equal(result.execArgv[0], '--no-warnings', 'flags passed (overridden default)') + t.equal(result.cwd, cwd, 'correct cwd folder') + }) + + workerFarm.end(child, function () { + t.ok(true, 'workerFarm ended') + }) +}) + + +tape('ensure --debug/--inspect not propagated to children', function (t) { + t.plan(3) + + let script = __dirname + '/debug.js' + , debugArg = process.version.replace(/^v(\d+)\..*$/, '$1') >= 8 ? '--inspect' : '--debug=8881' + , child = child_process.spawn(process.execPath, [ debugArg, script ]) + , stdout = '' + + child.stdout.on('data', function (data) { + stdout += data.toString() + }) + + child.on('close', function (code) { + t.equal(code, 0, 'exited without error (' + code + ')') + t.ok(stdout.indexOf('FINISHED') > -1, 'process finished') + t.ok(stdout.indexOf('--debug') === -1, 'child does not receive debug flag') + }) +}) |