diff options
Diffstat (limited to 'deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules')
72 files changed, 3872 insertions, 0 deletions
diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/index.js new file mode 100644 index 0000000000..0219cfa73f --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/index.js @@ -0,0 +1,275 @@ +'use strict'; +const childProcess = require('child_process'); +const util = require('util'); +const crossSpawn = require('cross-spawn'); +const stripEof = require('strip-eof'); +const npmRunPath = require('npm-run-path'); +const isStream = require('is-stream'); +const _getStream = require('get-stream'); +const pFinally = require('p-finally'); +const onExit = require('signal-exit'); +const errname = require('./lib/errname'); + +const TEN_MEGABYTES = 1000 * 1000 * 10; + +function handleArgs(cmd, args, opts) { + let parsed; + + if (opts && opts.__winShell === true) { + delete opts.__winShell; + parsed = { + command: cmd, + args, + options: opts, + file: cmd, + original: cmd + }; + } else { + parsed = crossSpawn._parse(cmd, args, opts); + } + + opts = Object.assign({ + maxBuffer: TEN_MEGABYTES, + stripEof: true, + preferLocal: true, + encoding: 'utf8', + reject: true, + cleanup: true + }, parsed.options); + + if (opts.preferLocal) { + opts.env = npmRunPath.env(opts); + } + + return { + cmd: parsed.command, + args: parsed.args, + opts + }; +} + +function handleInput(spawned, opts) { + const input = opts.input; + + if (input === null || input === undefined) { + return; + } + + if (isStream(input)) { + input.pipe(spawned.stdin); + } else { + spawned.stdin.end(input); + } +} + +function handleOutput(opts, val) { + if (val && opts.stripEof) { + val = stripEof(val); + } + + return val; +} + +function handleShell(fn, cmd, opts) { + let file = '/bin/sh'; + let args = ['-c', cmd]; + + opts = Object.assign({}, opts); + + if (process.platform === 'win32') { + opts.__winShell = true; + file = process.env.comspec || 'cmd.exe'; + args = ['/s', '/c', `"${cmd}"`]; + opts.windowsVerbatimArguments = true; + } + + if (opts.shell) { + file = opts.shell; + delete opts.shell; + } + + return fn(file, args, opts); +} + +function getStream(process, stream, encoding, maxBuffer) { + if (!process[stream]) { + return null; + } + + let ret; + + if (encoding) { + ret = _getStream(process[stream], { + encoding, + maxBuffer + }); + } else { + ret = _getStream.buffer(process[stream], {maxBuffer}); + } + + return ret.catch(err => { + err.stream = stream; + err.message = `${stream} ${err.message}`; + throw err; + }); +} + +module.exports = (cmd, args, opts) => { + let joinedCmd = cmd; + + if (Array.isArray(args) && args.length > 0) { + joinedCmd += ' ' + args.join(' '); + } + + const parsed = handleArgs(cmd, args, opts); + const encoding = parsed.opts.encoding; + const maxBuffer = parsed.opts.maxBuffer; + + let spawned; + try { + spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts); + } catch (err) { + return Promise.reject(err); + } + + let removeExitHandler; + if (parsed.opts.cleanup) { + removeExitHandler = onExit(() => { + spawned.kill(); + }); + } + + let timeoutId = null; + let timedOut = false; + + const cleanupTimeout = () => { + if (timeoutId) { + clearTimeout(timeoutId); + timeoutId = null; + } + }; + + if (parsed.opts.timeout > 0) { + timeoutId = setTimeout(() => { + timeoutId = null; + timedOut = true; + spawned.kill(parsed.killSignal); + }, parsed.opts.timeout); + } + + const processDone = new Promise(resolve => { + spawned.on('exit', (code, signal) => { + cleanupTimeout(); + resolve({code, signal}); + }); + + spawned.on('error', err => { + cleanupTimeout(); + resolve({err}); + }); + }); + + function destroy() { + if (spawned.stdout) { + spawned.stdout.destroy(); + } + + if (spawned.stderr) { + spawned.stderr.destroy(); + } + } + + const promise = pFinally(Promise.all([ + processDone, + getStream(spawned, 'stdout', encoding, maxBuffer), + getStream(spawned, 'stderr', encoding, maxBuffer) + ]).then(arr => { + const result = arr[0]; + const stdout = arr[1]; + const stderr = arr[2]; + + let err = result.err; + const code = result.code; + const signal = result.signal; + + if (removeExitHandler) { + removeExitHandler(); + } + + if (err || code !== 0 || signal !== null) { + if (!err) { + err = new Error(`Command failed: ${joinedCmd}\n${stderr}${stdout}`); + err.code = code < 0 ? errname(code) : code; + } + + // TODO: missing some timeout logic for killed + // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203 + // err.killed = spawned.killed || killed; + err.killed = err.killed || spawned.killed; + + err.stdout = stdout; + err.stderr = stderr; + err.failed = true; + err.signal = signal || null; + err.cmd = joinedCmd; + err.timedOut = timedOut; + + if (!parsed.opts.reject) { + return err; + } + + throw err; + } + + return { + stdout: handleOutput(parsed.opts, stdout), + stderr: handleOutput(parsed.opts, stderr), + code: 0, + failed: false, + killed: false, + signal: null, + cmd: joinedCmd, + timedOut: false + }; + }), destroy); + + crossSpawn._enoent.hookChildProcess(spawned, parsed); + + handleInput(spawned, parsed.opts); + + spawned.then = promise.then.bind(promise); + spawned.catch = promise.catch.bind(promise); + + return spawned; +}; + +module.exports.stdout = function () { + // TODO: set `stderr: 'ignore'` when that option is implemented + return module.exports.apply(null, arguments).then(x => x.stdout); +}; + +module.exports.stderr = function () { + // TODO: set `stdout: 'ignore'` when that option is implemented + return module.exports.apply(null, arguments).then(x => x.stderr); +}; + +module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts); + +module.exports.sync = (cmd, args, opts) => { + const parsed = handleArgs(cmd, args, opts); + + if (isStream(parsed.opts.input)) { + throw new TypeError('The `input` option cannot be a stream in sync mode'); + } + + const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts); + + result.stdout = handleOutput(parsed.opts, result.stdout); + result.stderr = handleOutput(parsed.opts, result.stderr); + + return result; +}; + +module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts); + +module.exports.spawn = util.deprecate(module.exports, 'execa.spawn() is deprecated. Use execa() instead.'); diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/lib/errname.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/lib/errname.js new file mode 100644 index 0000000000..a99d7500c2 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/lib/errname.js @@ -0,0 +1,37 @@ +'use strict'; +// The Node team wants to deprecate `process.bind(...)`. +// https://github.com/nodejs/node/pull/2768 +// +// However, we need the 'uv' binding for errname support. +// This is a defensive wrapper around it so `execa` will not fail entirely if it stops working someday. +// +// If this ever stops working. See: https://github.com/sindresorhus/execa/issues/31#issuecomment-215939939 for another possible solution. +let uv; + +try { + uv = process.binding('uv'); + + if (typeof uv.errname !== 'function') { + throw new Error('uv.errname is not a function'); + } +} catch (err) { + console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err); + uv = null; +} + +function errname(uv, code) { + if (uv) { + return uv.errname(code); + } + + if (!(code < 0)) { + throw new Error('err >= 0'); + } + + return `Unknown system error ${code}`; +} + +module.exports = code => errname(uv, code); + +// used for testing the fallback behavior +module.exports.__test__ = errname; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/license b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/LICENSE b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/LICENSE new file mode 100644 index 0000000000..db5e914de1 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 IndigoUnited + +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/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/README.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/README.md new file mode 100644 index 0000000000..18cc2b8bc8 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/README.md @@ -0,0 +1,71 @@ +# cross-spawn + +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Build status][appveyor-image]][appveyor-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url] + +[npm-url]:https://npmjs.org/package/cross-spawn +[downloads-image]:http://img.shields.io/npm/dm/cross-spawn.svg +[npm-image]:http://img.shields.io/npm/v/cross-spawn.svg +[travis-url]:https://travis-ci.org/IndigoUnited/node-cross-spawn +[travis-image]:http://img.shields.io/travis/IndigoUnited/node-cross-spawn/master.svg +[appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn +[appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg +[david-dm-url]:https://david-dm.org/IndigoUnited/node-cross-spawn +[david-dm-image]:https://img.shields.io/david/IndigoUnited/node-cross-spawn.svg +[david-dm-dev-url]:https://david-dm.org/IndigoUnited/node-cross-spawn#info=devDependencies +[david-dm-dev-image]:https://img.shields.io/david/dev/IndigoUnited/node-cross-spawn.svg + +A cross platform solution to node's spawn and spawnSync. + + +## Installation + +`$ npm install cross-spawn` + +If you are using `spawnSync` on node 0.10 or older, you will also need to install `spawn-sync`: + +`$ npm install spawn-sync` + + +## Why + +Node has issues when using spawn on Windows: + +- It ignores [PATHEXT](https://github.com/joyent/node/issues/2318) +- It does not support [shebangs](http://pt.wikipedia.org/wiki/Shebang) +- It does not allow you to run `del` or `dir` +- It does not properly escape arguments with spaces or special characters + +All these issues are handled correctly by `cross-spawn`. +There are some known modules, such as [win-spawn](https://github.com/ForbesLindesay/win-spawn), that try to solve this but they are either broken or provide faulty escaping of shell arguments. + + +## Usage + +Exactly the same way as node's [`spawn`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) or [`spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options), so it's a drop in replacement. + +```javascript +var spawn = require('cross-spawn'); + +// Spawn NPM asynchronously +var child = spawn('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' }); + +// Spawn NPM synchronously +var results = spawn.sync('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' }); +``` + +## Caveat + +On Windows, cross-spawn will only spawn `cmd.exe` if necessary. If the extension +of the executable is `.exe` or `.com`, it will spawn it directly. If you wish +to override this behavior and *always* spawn a shell, pass the `{shell: true}` +option. + + +## Tests + +`$ npm test` + + +## License + +Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/index.js new file mode 100644 index 0000000000..7814a9692d --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/index.js @@ -0,0 +1,59 @@ +'use strict'; + +var cp = require('child_process'); +var parse = require('./lib/parse'); +var enoent = require('./lib/enoent'); + +var cpSpawnSync = cp.spawnSync; + +function spawn(command, args, options) { + var parsed; + var spawned; + + // Parse the arguments + parsed = parse(command, args, options); + + // Spawn the child process + spawned = cp.spawn(parsed.command, parsed.args, parsed.options); + + // Hook into child process "exit" event to emit an error if the command + // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + enoent.hookChildProcess(spawned, parsed); + + return spawned; +} + +function spawnSync(command, args, options) { + var parsed; + var result; + + if (!cpSpawnSync) { + try { + cpSpawnSync = require('spawn-sync'); // eslint-disable-line global-require + } catch (ex) { + throw new Error( + 'In order to use spawnSync on node 0.10 or older, you must ' + + 'install spawn-sync:\n\n' + + ' npm install spawn-sync --save' + ); + } + } + + // Parse the arguments + parsed = parse(command, args, options); + + // Spawn the child process + result = cpSpawnSync(parsed.command, parsed.args, parsed.options); + + // Analyze if the command does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); + + return result; +} + +module.exports = spawn; +module.exports.spawn = spawn; +module.exports.sync = spawnSync; + +module.exports._parse = parse; +module.exports._enoent = enoent; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/lib/enoent.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/lib/enoent.js new file mode 100644 index 0000000000..74ff06e495 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/lib/enoent.js @@ -0,0 +1,73 @@ +'use strict'; + +var isWin = process.platform === 'win32'; +var resolveCommand = require('./resolveCommand'); + +var isNode10 = process.version.indexOf('v0.10.') === 0; + +function notFoundError(command, syscall) { + var err; + + err = new Error(syscall + ' ' + command + ' ENOENT'); + err.code = err.errno = 'ENOENT'; + err.syscall = syscall + ' ' + command; + + return err; +} + +function hookChildProcess(cp, parsed) { + var originalEmit; + + if (!isWin) { + return; + } + + originalEmit = cp.emit; + cp.emit = function (name, arg1) { + var err; + + // If emitting "exit" event and exit code is 1, we need to check if + // the command exists and emit an "error" instead + // See: https://github.com/IndigoUnited/node-cross-spawn/issues/16 + if (name === 'exit') { + err = verifyENOENT(arg1, parsed, 'spawn'); + + if (err) { + return originalEmit.call(cp, 'error', err); + } + } + + return originalEmit.apply(cp, arguments); + }; +} + +function verifyENOENT(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawn'); + } + + return null; +} + +function verifyENOENTSync(status, parsed) { + if (isWin && status === 1 && !parsed.file) { + return notFoundError(parsed.original, 'spawnSync'); + } + + // If we are in node 10, then we are using spawn-sync; if it exited + // with -1 it probably means that the command does not exist + if (isNode10 && status === -1) { + parsed.file = isWin ? parsed.file : resolveCommand(parsed.original); + + if (!parsed.file) { + return notFoundError(parsed.original, 'spawnSync'); + } + } + + return null; +} + +module.exports.hookChildProcess = hookChildProcess; +module.exports.verifyENOENT = verifyENOENT; +module.exports.verifyENOENTSync = verifyENOENTSync; +module.exports.notFoundError = notFoundError; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/lib/hasBrokenSpawn.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/lib/hasBrokenSpawn.js new file mode 100644 index 0000000000..e73f906b61 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/lib/hasBrokenSpawn.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = (function () { + if (process.platform !== 'win32') { + return false; + } + var nodeVer = process.version.substr(1).split('.').map(function (num) { + return parseInt(num, 10); + }); + return (nodeVer[0] === 0 && nodeVer[1] < 12); +})(); diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/lib/parse.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/lib/parse.js new file mode 100644 index 0000000000..77cbb83d2d --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/lib/parse.js @@ -0,0 +1,140 @@ +'use strict'; + +var fs = require('fs'); +var LRU = require('lru-cache'); +var resolveCommand = require('./resolveCommand'); +var hasBrokenSpawn = require('./hasBrokenSpawn'); + +var isWin = process.platform === 'win32'; +var shebangCache = new LRU({ max: 50, maxAge: 30 * 1000 }); // Cache just for 30sec + +function readShebang(command) { + var buffer; + var fd; + var match; + var shebang; + + // Check if it is in the cache first + if (shebangCache.has(command)) { + return shebangCache.get(command); + } + + // Read the first 150 bytes from the file + buffer = new Buffer(150); + + try { + fd = fs.openSync(command, 'r'); + fs.readSync(fd, buffer, 0, 150, 0); + fs.closeSync(fd); + } catch (e) { /* empty */ } + + // Check if it is a shebang + match = buffer.toString().trim().match(/#!(.+)/i); + + if (match) { + shebang = match[1].replace(/\/usr\/bin\/env\s+/i, ''); // Remove /usr/bin/env + } + + // Store the shebang in the cache + shebangCache.set(command, shebang); + + return shebang; +} + +function escapeArg(arg, quote) { + // Convert to string + arg = '' + arg; + + // If we are not going to quote the argument, + // escape shell metacharacters, including double and single quotes: + if (!quote) { + arg = arg.replace(/([\(\)%!\^<>&|;,"'\s])/g, '^$1'); + } else { + // Sequence of backslashes followed by a double quote: + // double up all the backslashes and escape the double quote + arg = arg.replace(/(\\*)"/g, '$1$1\\"'); + + // Sequence of backslashes followed by the end of the string + // (which will become a double quote later): + // double up all the backslashes + arg = arg.replace(/(\\*)$/, '$1$1'); + + // All other backslashes occur literally + + // Quote the whole thing: + arg = '"' + arg + '"'; + } + + return arg; +} + +function escapeCommand(command) { + // Do not escape if this command is not dangerous.. + // We do this so that commands like "echo" or "ifconfig" work + // Quoting them, will make them unaccessible + return /^[a-z0-9_-]+$/i.test(command) ? command : escapeArg(command, true); +} + +function requiresShell(command) { + return !/\.(?:com|exe)$/i.test(command); +} + +function parse(command, args, options) { + var shebang; + var applyQuotes; + var file; + var original; + var shell; + + // Normalize arguments, similar to nodejs + if (args && !Array.isArray(args)) { + options = args; + args = null; + } + + args = args ? args.slice(0) : []; // Clone array to avoid changing the original + options = options || {}; + original = command; + + if (isWin) { + // Detect & add support for shebangs + file = resolveCommand(command); + file = file || resolveCommand(command, true); + shebang = file && readShebang(file); + shell = options.shell || hasBrokenSpawn; + + if (shebang) { + args.unshift(file); + command = shebang; + shell = shell || requiresShell(resolveCommand(shebang) || resolveCommand(shebang, true)); + } else { + shell = shell || requiresShell(file); + } + + if (shell) { + // Escape command & arguments + applyQuotes = (command !== 'echo'); // Do not quote arguments for the special "echo" command + command = escapeCommand(command); + args = args.map(function (arg) { + return escapeArg(arg, applyQuotes); + }); + + // Use cmd.exe + args = ['/s', '/c', '"' + command + (args.length ? ' ' + args.join(' ') : '') + '"']; + command = process.env.comspec || 'cmd.exe'; + + // Tell node's spawn that the arguments are already escaped + options.windowsVerbatimArguments = true; + } + } + + return { + command: command, + args: args, + options: options, + file: file, + original: original, + }; +} + +module.exports = parse; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/lib/resolveCommand.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/lib/resolveCommand.js new file mode 100644 index 0000000000..b7a9490974 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/lib/resolveCommand.js @@ -0,0 +1,31 @@ +'use strict'; + +var path = require('path'); +var which = require('which'); +var LRU = require('lru-cache'); + +var commandCache = new LRU({ max: 50, maxAge: 30 * 1000 }); // Cache just for 30sec + +function resolveCommand(command, noExtension) { + var resolved; + + noExtension = !!noExtension; + resolved = commandCache.get(command + '!' + noExtension); + + // Check if its resolved in the cache + if (commandCache.has(command)) { + return commandCache.get(command); + } + + try { + resolved = !noExtension ? + which.sync(command) : + which.sync(command, { pathExt: path.delimiter + (process.env.PATHEXT || '') }); + } catch (e) { /* empty */ } + + commandCache.set(command + '!' + noExtension, resolved); + + return resolved; +} + +module.exports = resolveCommand; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/package.json new file mode 100644 index 0000000000..c269a6260b --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/cross-spawn/package.json @@ -0,0 +1,48 @@ +{ + "_from": "cross-spawn@^4.0.0", + "_id": "cross-spawn@4.0.2", + "_inBundle": false, + "_integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", + "_location": "/libnpx/yargs/os-locale/execa/cross-spawn", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "cross-spawn@^4.0.0", + "name": "cross-spawn", + "escapedName": "cross-spawn", + "rawSpec": "^4.0.0", + "saveSpec": null, + "fetchSpec": "^4.0.0" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale/execa" + ], + "_resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", + "_shasum": "7b9247621c23adfdd3856004a823cbe397424d41", + "_shrinkwrap": null, + "_spec": "cross-spawn@^4.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa", + "bin": null, + "bundleDependencies": false, + "dependencies": { + "lru-cache": "^4.0.1", + "which": "^1.2.9" + }, + "deprecated": false, + "description": "[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Build status][appveyor-image]][appveyor-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]", + "devDependencies": { + "@satazor/eslint-config": "^3.0.0", + "eslint": "^3.0.0", + "expect.js": "^0.3.0", + "glob": "^7.0.0", + "mkdirp": "^0.5.1", + "mocha": "^3.0.2", + "rimraf": "^2.5.0" + }, + "name": "cross-spawn", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "4.0.2" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/buffer-stream.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/buffer-stream.js new file mode 100644 index 0000000000..cc834c4dc8 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/buffer-stream.js @@ -0,0 +1,54 @@ +var PassThrough = require('stream').PassThrough; +var objectAssign = require('object-assign'); + +module.exports = function (opts) { + opts = objectAssign({}, opts); + + var array = opts.array; + var encoding = opts.encoding; + + var buffer = encoding === 'buffer'; + var objectMode = false; + + if (array) { + objectMode = !(encoding || buffer); + } else { + encoding = encoding || 'utf8'; + } + + if (buffer) { + encoding = null; + } + + var len = 0; + var ret = []; + + var stream = new PassThrough({objectMode: objectMode}); + + if (encoding) { + stream.setEncoding(encoding); + } + + stream.on('data', function (chunk) { + ret.push(chunk); + + if (objectMode) { + len = ret.length; + } else { + len += chunk.length; + } + }); + + stream.getBufferedValue = function () { + if (array) { + return ret; + } + return buffer ? Buffer.concat(ret, len) : ret.join(''); + }; + + stream.getBufferedLength = function () { + return len; + }; + + return stream; +}; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/index.js new file mode 100644 index 0000000000..aa60cf038f --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/index.js @@ -0,0 +1,59 @@ +'use strict'; +var Promise = require('pinkie-promise'); +var objectAssign = require('object-assign'); +var bufferStream = require('./buffer-stream'); + +function getStream(inputStream, opts) { + if (!inputStream) { + return Promise.reject(new Error('Expected a stream')); + } + + opts = objectAssign({maxBuffer: Infinity}, opts); + var maxBuffer = opts.maxBuffer; + var stream; + var clean; + + var p = new Promise(function (resolve, reject) { + stream = bufferStream(opts); + inputStream.once('error', error); + inputStream.pipe(stream); + + stream.on('data', function () { + if (stream.getBufferedLength() > maxBuffer) { + reject(new Error('maxBuffer exceeded')); + } + }); + stream.once('error', error); + stream.on('end', resolve); + + clean = function () { + // some streams doesn't implement the stream.Readable interface correctly + if (inputStream.unpipe) { + inputStream.unpipe(stream); + } + }; + + function error(err) { + if (err) { // null check + err.bufferedData = stream.getBufferedValue(); + } + reject(err); + } + }); + + p.then(clean, clean); + + return p.then(function () { + return stream.getBufferedValue(); + }); +} + +module.exports = getStream; + +module.exports.buffer = function (stream, opts) { + return getStream(stream, objectAssign({}, opts, {encoding: 'buffer'})); +}; + +module.exports.array = function (stream, opts) { + return getStream(stream, objectAssign({}, opts, {array: true})); +}; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/license b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/object-assign/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/object-assign/index.js new file mode 100644 index 0000000000..0930cf8890 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/object-assign/index.js @@ -0,0 +1,90 @@ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +'use strict'; +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/object-assign/license b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/object-assign/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/object-assign/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/object-assign/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/object-assign/package.json new file mode 100644 index 0000000000..cb1283bace --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/object-assign/package.json @@ -0,0 +1,45 @@ +{ + "_from": "object-assign@^4.0.1", + "_id": "object-assign@4.1.1", + "_inBundle": false, + "_integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "_location": "/libnpx/yargs/os-locale/execa/get-stream/object-assign", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "object-assign@^4.0.1", + "name": "object-assign", + "escapedName": "object-assign", + "rawSpec": "^4.0.1", + "saveSpec": null, + "fetchSpec": "^4.0.1" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale/execa/get-stream" + ], + "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "_shasum": "2109adc7965887cfc05cbbd442cac8bfbb360863", + "_shrinkwrap": null, + "_spec": "object-assign@^4.0.1", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream", + "bin": null, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com)", + "devDependencies": { + "ava": "^0.16.0", + "lodash": "^4.16.4", + "matcha": "^0.7.0", + "xo": "^0.16.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "name": "object-assign", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "4.1.1" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/object-assign/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/object-assign/readme.md new file mode 100644 index 0000000000..1be09d35c7 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/object-assign/readme.md @@ -0,0 +1,61 @@ +# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) + +> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com) + + +## Use the built-in + +Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari), +support `Object.assign()` :tada:. If you target only those environments, then by all +means, use `Object.assign()` instead of this package. + + +## Install + +``` +$ npm install --save object-assign +``` + + +## Usage + +```js +const objectAssign = require('object-assign'); + +objectAssign({foo: 0}, {bar: 1}); +//=> {foo: 0, bar: 1} + +// multiple sources +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); +//=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} +``` + + +## API + +### objectAssign(target, [source, ...]) + +Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. + + +## Resources + +- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) + + +## Related + +- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/index.js new file mode 100644 index 0000000000..777377a1f7 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = typeof Promise === 'function' ? Promise : require('pinkie'); diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/license b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/license new file mode 100644 index 0000000000..1aeb74fd25 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Vsevolod Strukchinsky <floatdrop@gmail.com> (github.com/floatdrop) + +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/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/node_modules/pinkie/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/node_modules/pinkie/index.js new file mode 100644 index 0000000000..14ce1bfe3d --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/node_modules/pinkie/index.js @@ -0,0 +1,292 @@ +'use strict'; + +var PENDING = 'pending'; +var SETTLED = 'settled'; +var FULFILLED = 'fulfilled'; +var REJECTED = 'rejected'; +var NOOP = function () {}; +var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function'; + +var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate; +var asyncQueue = []; +var asyncTimer; + +function asyncFlush() { + // run promise callbacks + for (var i = 0; i < asyncQueue.length; i++) { + asyncQueue[i][0](asyncQueue[i][1]); + } + + // reset async asyncQueue + asyncQueue = []; + asyncTimer = false; +} + +function asyncCall(callback, arg) { + asyncQueue.push([callback, arg]); + + if (!asyncTimer) { + asyncTimer = true; + asyncSetTimer(asyncFlush, 0); + } +} + +function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + + function rejectPromise(reason) { + reject(promise, reason); + } + + try { + resolver(resolvePromise, rejectPromise); + } catch (e) { + rejectPromise(e); + } +} + +function invokeCallback(subscriber) { + var owner = subscriber.owner; + var settled = owner._state; + var value = owner._data; + var callback = subscriber[settled]; + var promise = subscriber.then; + + if (typeof callback === 'function') { + settled = FULFILLED; + try { + value = callback(value); + } catch (e) { + reject(promise, e); + } + } + + if (!handleThenable(promise, value)) { + if (settled === FULFILLED) { + resolve(promise, value); + } + + if (settled === REJECTED) { + reject(promise, value); + } + } +} + +function handleThenable(promise, value) { + var resolved; + + try { + if (promise === value) { + throw new TypeError('A promises callback cannot return that same promise.'); + } + + if (value && (typeof value === 'function' || typeof value === 'object')) { + // then should be retrieved only once + var then = value.then; + + if (typeof then === 'function') { + then.call(value, function (val) { + if (!resolved) { + resolved = true; + + if (value === val) { + fulfill(promise, val); + } else { + resolve(promise, val); + } + } + }, function (reason) { + if (!resolved) { + resolved = true; + + reject(promise, reason); + } + }); + + return true; + } + } + } catch (e) { + if (!resolved) { + reject(promise, e); + } + + return true; + } + + return false; +} + +function resolve(promise, value) { + if (promise === value || !handleThenable(promise, value)) { + fulfill(promise, value); + } +} + +function fulfill(promise, value) { + if (promise._state === PENDING) { + promise._state = SETTLED; + promise._data = value; + + asyncCall(publishFulfillment, promise); + } +} + +function reject(promise, reason) { + if (promise._state === PENDING) { + promise._state = SETTLED; + promise._data = reason; + + asyncCall(publishRejection, promise); + } +} + +function publish(promise) { + promise._then = promise._then.forEach(invokeCallback); +} + +function publishFulfillment(promise) { + promise._state = FULFILLED; + publish(promise); +} + +function publishRejection(promise) { + promise._state = REJECTED; + publish(promise); + if (!promise._handled && isNode) { + global.process.emit('unhandledRejection', promise._data, promise); + } +} + +function notifyRejectionHandled(promise) { + global.process.emit('rejectionHandled', promise); +} + +/** + * @class + */ +function Promise(resolver) { + if (typeof resolver !== 'function') { + throw new TypeError('Promise resolver ' + resolver + ' is not a function'); + } + + if (this instanceof Promise === false) { + throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); + } + + this._then = []; + + invokeResolver(resolver, this); +} + +Promise.prototype = { + constructor: Promise, + + _state: PENDING, + _then: null, + _data: undefined, + _handled: false, + + then: function (onFulfillment, onRejection) { + var subscriber = { + owner: this, + then: new this.constructor(NOOP), + fulfilled: onFulfillment, + rejected: onRejection + }; + + if ((onRejection || onFulfillment) && !this._handled) { + this._handled = true; + if (this._state === REJECTED && isNode) { + asyncCall(notifyRejectionHandled, this); + } + } + + if (this._state === FULFILLED || this._state === REJECTED) { + // already resolved, call callback async + asyncCall(invokeCallback, subscriber); + } else { + // subscribe + this._then.push(subscriber); + } + + return subscriber.then; + }, + + catch: function (onRejection) { + return this.then(null, onRejection); + } +}; + +Promise.all = function (promises) { + if (!Array.isArray(promises)) { + throw new TypeError('You must pass an array to Promise.all().'); + } + + return new Promise(function (resolve, reject) { + var results = []; + var remaining = 0; + + function resolver(index) { + remaining++; + return function (value) { + results[index] = value; + if (!--remaining) { + resolve(results); + } + }; + } + + for (var i = 0, promise; i < promises.length; i++) { + promise = promises[i]; + + if (promise && typeof promise.then === 'function') { + promise.then(resolver(i), reject); + } else { + results[i] = promise; + } + } + + if (!remaining) { + resolve(results); + } + }); +}; + +Promise.race = function (promises) { + if (!Array.isArray(promises)) { + throw new TypeError('You must pass an array to Promise.race().'); + } + + return new Promise(function (resolve, reject) { + for (var i = 0, promise; i < promises.length; i++) { + promise = promises[i]; + + if (promise && typeof promise.then === 'function') { + promise.then(resolve, reject); + } else { + resolve(promise); + } + } + }); +}; + +Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + + return new Promise(function (resolve) { + resolve(value); + }); +}; + +Promise.reject = function (reason) { + return new Promise(function (resolve, reject) { + reject(reason); + }); +}; + +module.exports = Promise; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/node_modules/pinkie/license b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/node_modules/pinkie/license new file mode 100644 index 0000000000..1aeb74fd25 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/node_modules/pinkie/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Vsevolod Strukchinsky <floatdrop@gmail.com> (github.com/floatdrop) + +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/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/node_modules/pinkie/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/node_modules/pinkie/package.json new file mode 100644 index 0000000000..d94124cdf5 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/node_modules/pinkie/package.json @@ -0,0 +1,47 @@ +{ + "_from": "pinkie@^2.0.0", + "_id": "pinkie@2.0.4", + "_inBundle": false, + "_integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "_location": "/libnpx/yargs/os-locale/execa/get-stream/pinkie-promise/pinkie", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pinkie@^2.0.0", + "name": "pinkie", + "escapedName": "pinkie", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale/execa/get-stream/pinkie-promise" + ], + "_resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "_shasum": "72556b80cfa0d48a974e80e77248e80ed4f7f870", + "_shrinkwrap": null, + "_spec": "pinkie@^2.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise", + "bin": null, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "<h1 align=\"center\"> \t<br> \t<img width=\"256\" src=\"media/logo.png\" alt=\"pinkie\"> \t<br> \t<br> </h1>", + "devDependencies": { + "core-assert": "^0.1.1", + "coveralls": "^2.11.4", + "mocha": "*", + "nyc": "^3.2.2", + "promises-aplus-tests": "*", + "xo": "^0.10.1" + }, + "engines": { + "node": ">=0.10.0" + }, + "name": "pinkie", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "2.0.4" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/node_modules/pinkie/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/node_modules/pinkie/readme.md new file mode 100644 index 0000000000..54747f60cc --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/node_modules/pinkie/readme.md @@ -0,0 +1,83 @@ +<h1 align="center"> + <br> + <img width="256" src="media/logo.png" alt="pinkie"> + <br> + <br> +</h1> + +> Itty bitty little widdle twinkie pinkie [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation + +[![Build Status](https://travis-ci.org/floatdrop/pinkie.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie) [![Coverage Status](https://coveralls.io/repos/floatdrop/pinkie/badge.svg?branch=master&service=github)](https://coveralls.io/github/floatdrop/pinkie?branch=master) + +There are [tons of Promise implementations](https://github.com/promises-aplus/promises-spec/blob/master/implementations.md#standalone) out there, but all of them focus on browser compatibility and are often bloated with functionality. + +This module is an exact Promise specification polyfill (like [native-promise-only](https://github.com/getify/native-promise-only)), but in Node.js land (it should be browserify-able though). + + +## Install + +``` +$ npm install --save pinkie +``` + + +## Usage + +```js +var fs = require('fs'); +var Promise = require('pinkie'); + +new Promise(function (resolve, reject) { + fs.readFile('foo.json', 'utf8', function (err, data) { + if (err) { + reject(err); + return; + } + + resolve(data); + }); +}); +//=> Promise +``` + + +### API + +`pinkie` exports bare [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation and polyfills [Node.js rejection events](https://nodejs.org/api/process.html#process_event_unhandledrejection). In case you forgot: + +#### new Promise(executor) + +Returns new instance of `Promise`. + +##### executor + +*Required* +Type: `function` + +Function with two arguments `resolve` and `reject`. The first argument fulfills the promise, the second argument rejects it. + +#### pinkie.all(promises) + +Returns a promise that resolves when all of the promises in the `promises` Array argument have resolved. + +#### pinkie.race(promises) + +Returns a promise that resolves or rejects as soon as one of the promises in the `promises` Array resolves or rejects, with the value or reason from that promise. + +#### pinkie.reject(reason) + +Returns a Promise object that is rejected with the given `reason`. + +#### pinkie.resolve(value) + +Returns a Promise object that is resolved with the given `value`. If the `value` is a thenable (i.e. has a then method), the returned promise will "follow" that thenable, adopting its eventual state; otherwise the returned promise will be fulfilled with the `value`. + + +## Related + +- [pinkie-promise](https://github.com/floatdrop/pinkie-promise) - Returns the native Promise or this module + + +## License + +MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/package.json new file mode 100644 index 0000000000..96227946d8 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/package.json @@ -0,0 +1,44 @@ +{ + "_from": "pinkie-promise@^2.0.0", + "_id": "pinkie-promise@2.0.1", + "_inBundle": false, + "_integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "_location": "/libnpx/yargs/os-locale/execa/get-stream/pinkie-promise", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pinkie-promise@^2.0.0", + "name": "pinkie-promise", + "escapedName": "pinkie-promise", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale/execa/get-stream" + ], + "_resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "_shasum": "2135d6dfa7a358c069ac9b178776288228450ffa", + "_shrinkwrap": null, + "_spec": "pinkie-promise@^2.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream", + "bin": null, + "bundleDependencies": false, + "dependencies": { + "pinkie": "^2.0.0" + }, + "deprecated": false, + "description": "> [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) ponyfill", + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "name": "pinkie-promise", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "2.0.1" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/readme.md new file mode 100644 index 0000000000..78477f4297 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/node_modules/pinkie-promise/readme.md @@ -0,0 +1,28 @@ +# pinkie-promise [![Build Status](https://travis-ci.org/floatdrop/pinkie-promise.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie-promise) + +> [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) ponyfill + +Module exports global Promise object (if available) or [`pinkie`](http://github.com/floatdrop/pinkie) Promise polyfill. + +## Install + +``` +$ npm install --save pinkie-promise +``` + +## Usage + +```js +var Promise = require('pinkie-promise'); + +new Promise(function (resolve) { resolve('unicorns'); }); +//=> Promise { 'unicorns' } +``` + +## Related + +- [pify](https://github.com/sindresorhus/pify) - Promisify a callback-style function + +## License + +MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/package.json new file mode 100644 index 0000000000..90ff4f2098 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/package.json @@ -0,0 +1,48 @@ +{ + "_from": "get-stream@^2.2.0", + "_id": "get-stream@2.3.1", + "_inBundle": false, + "_integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", + "_location": "/libnpx/yargs/os-locale/execa/get-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "get-stream@^2.2.0", + "name": "get-stream", + "escapedName": "get-stream", + "rawSpec": "^2.2.0", + "saveSpec": null, + "fetchSpec": "^2.2.0" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale/execa" + ], + "_resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", + "_shasum": "5f38f93f346009666ee0150a054167f91bdd95de", + "_shrinkwrap": null, + "_spec": "get-stream@^2.2.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa", + "bin": null, + "bundleDependencies": false, + "dependencies": { + "object-assign": "^4.0.1", + "pinkie-promise": "^2.0.0" + }, + "deprecated": false, + "description": "> Get a stream as a string, buffer, or array", + "devDependencies": { + "ava": "*", + "buffer-equals": "^1.0.3", + "into-stream": "^2.0.1", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "name": "get-stream", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "2.3.1" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/readme.md new file mode 100644 index 0000000000..a74866bb29 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/get-stream/readme.md @@ -0,0 +1,115 @@ +# get-stream [![Build Status](https://travis-ci.org/sindresorhus/get-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/get-stream) + +> Get a stream as a string, buffer, or array + + +## Install + +``` +$ npm install --save get-stream +``` + + +## Usage + +```js +const fs = require('fs'); +const getStream = require('get-stream'); +const stream = fs.createReadStream('unicorn.txt'); + +getStream(stream).then(str => { + console.log(str); + /* + ,,))))))));, + __)))))))))))))), + \|/ -\(((((''''((((((((. + -*-==//////(('' . `)))))), + /|\ ))| o ;-. '((((( ,(, + ( `| / ) ;))))' ,_))^;(~ + | | | ,))((((_ _____------~~~-. %,;(;(>';'~ + o_); ; )))(((` ~---~ `:: \ %%~~)(v;(`('~ + ; ''''```` `: `:::|\,__,%% );`'; ~ + | _ ) / `:|`----' `-' + ______/\/~ | / / + /~;;.____/;;' / ___--,-( `;;;/ + / // _;______;'------~~~~~ /;;/\ / + // | | / ; \;;,\ + (<_ | ; /',/-----' _> + \_| ||_ //~;~~~~~~~~~ + `\_| (,~~ + \~\ + ~~ + */ +}); +``` + + +## API + +The methods returns a promise that is resolved when the `end` event fires on the stream, indicating that there is no more data to be read. The stream is switched to flowing mode. + +### getStream(stream, [options]) + +Get the `stream` as a string. + +#### options + +##### encoding + +Type: `string`<br> +Default: `utf8` + +[Encoding](https://nodejs.org/api/buffer.html#buffer_buffer) of the incoming stream. + +##### maxBuffer + +Type: `number`<br> +Default: `Infinity` + +Maximum length of the returned string. If it exceeds this value before the stream ends, the promise will be rejected. + +### getStream.buffer(stream, [options]) + +Get the `stream` as a buffer. + +It honors the `maxBuffer` option as above, but it refers to byte length rather than string length. + +### getStream.array(stream, [options]) + +Get the `stream` as an array of values. + +It honors both the `maxBuffer` and `encoding` options. The behavior changes slightly based on the encoding chosen: + +- When `encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer` refers to the number of items in the array (not the sum of their sizes). + +- When `encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer` refers to the summed byte lengths of every buffer in the array. + +- When `encoding` is set to anything else, it collects an array of strings. `maxBuffer` refers to the summed character lengths of every string in the array. + + +## Errors + +If the input stream emits an `error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData` property of the error. + +```js +getStream(streamThatErrorsAtTheEnd('unicorn')) + .catch(err => console.log(err.bufferedData)); +// unicorn +``` + + +## FAQ + +### How is this different from [`concat-stream`](https://github.com/maxogden/concat-stream)? + +This module accepts a stream instead of being one and returns a promise instead of using a callback. The API is simpler and it only supports returning a string, buffer, or array. It doesn't have a fragile type inference. You explicitly choose what you want. And it doesn't depend on the huge `readable-stream` package. + + +## Related + +- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/is-stream/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/is-stream/index.js new file mode 100644 index 0000000000..6f7ec91a40 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/is-stream/index.js @@ -0,0 +1,21 @@ +'use strict'; + +var isStream = module.exports = function (stream) { + return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; +}; + +isStream.writable = function (stream) { + return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; +}; + +isStream.readable = function (stream) { + return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; +}; + +isStream.duplex = function (stream) { + return isStream.writable(stream) && isStream.readable(stream); +}; + +isStream.transform = function (stream) { + return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; +}; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/is-stream/license b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/is-stream/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/is-stream/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/is-stream/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/is-stream/package.json new file mode 100644 index 0000000000..71d370718e --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/is-stream/package.json @@ -0,0 +1,44 @@ +{ + "_from": "is-stream@^1.1.0", + "_id": "is-stream@1.1.0", + "_inBundle": false, + "_integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "_location": "/libnpx/yargs/os-locale/execa/is-stream", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-stream@^1.1.0", + "name": "is-stream", + "escapedName": "is-stream", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale/execa" + ], + "_resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "_shasum": "12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44", + "_shrinkwrap": null, + "_spec": "is-stream@^1.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa", + "bin": null, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "> Check if something is a [Node.js stream](https://nodejs.org/api/stream.html)", + "devDependencies": { + "ava": "*", + "tempfile": "^1.1.0", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "name": "is-stream", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/is-stream/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/is-stream/readme.md new file mode 100644 index 0000000000..d8afce81d2 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/is-stream/readme.md @@ -0,0 +1,42 @@ +# is-stream [![Build Status](https://travis-ci.org/sindresorhus/is-stream.svg?branch=master)](https://travis-ci.org/sindresorhus/is-stream) + +> Check if something is a [Node.js stream](https://nodejs.org/api/stream.html) + + +## Install + +``` +$ npm install --save is-stream +``` + + +## Usage + +```js +const fs = require('fs'); +const isStream = require('is-stream'); + +isStream(fs.createReadStream('unicorn.png')); +//=> true + +isStream({}); +//=> false +``` + + +## API + +### isStream(stream) + +#### isStream.writable(stream) + +#### isStream.readable(stream) + +#### isStream.duplex(stream) + +#### isStream.transform(stream) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/index.js new file mode 100644 index 0000000000..56f31e4712 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/index.js @@ -0,0 +1,39 @@ +'use strict'; +const path = require('path'); +const pathKey = require('path-key'); + +module.exports = opts => { + opts = Object.assign({ + cwd: process.cwd(), + path: process.env[pathKey()] + }, opts); + + let prev; + let pth = path.resolve(opts.cwd); + const ret = []; + + while (prev !== pth) { + ret.push(path.join(pth, 'node_modules/.bin')); + prev = pth; + pth = path.resolve(pth, '..'); + } + + // ensure the running `node` binary is used + ret.push(path.dirname(process.execPath)); + + return ret.concat(opts.path).join(path.delimiter); +}; + +module.exports.env = opts => { + opts = Object.assign({ + env: process.env + }, opts); + + const env = Object.assign({}, opts.env); + const path = pathKey({env}); + + opts.path = env[path]; + env[path] = module.exports(opts); + + return env; +}; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/license b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/node_modules/path-key/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/node_modules/path-key/index.js new file mode 100644 index 0000000000..62c8250ab4 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/node_modules/path-key/index.js @@ -0,0 +1,13 @@ +'use strict'; +module.exports = opts => { + opts = opts || {}; + + const env = opts.env || process.env; + const platform = opts.platform || process.platform; + + if (platform !== 'win32') { + return 'PATH'; + } + + return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; +}; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/node_modules/path-key/license b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/node_modules/path-key/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/node_modules/path-key/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/node_modules/path-key/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/node_modules/path-key/package.json new file mode 100644 index 0000000000..520f68ad04 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/node_modules/path-key/package.json @@ -0,0 +1,43 @@ +{ + "_from": "path-key@^2.0.0", + "_id": "path-key@2.0.1", + "_inBundle": false, + "_integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "_location": "/libnpx/yargs/os-locale/execa/npm-run-path/path-key", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-key@^2.0.0", + "name": "path-key", + "escapedName": "path-key", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale/execa/npm-run-path" + ], + "_resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "_shasum": "411cadb574c5a140d3a4b1910d40d80cc9f40b40", + "_shrinkwrap": null, + "_spec": "path-key@^2.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path", + "bin": null, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "name": "path-key", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "2.0.1" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/node_modules/path-key/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/node_modules/path-key/readme.md new file mode 100644 index 0000000000..cb5710aace --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/node_modules/path-key/readme.md @@ -0,0 +1,51 @@ +# path-key [![Build Status](https://travis-ci.org/sindresorhus/path-key.svg?branch=master)](https://travis-ci.org/sindresorhus/path-key) + +> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform + +It's usually `PATH`, but on Windows it can be any casing like `Path`... + + +## Install + +``` +$ npm install --save path-key +``` + + +## Usage + +```js +const pathKey = require('path-key'); + +const key = pathKey(); +//=> 'PATH' + +const PATH = process.env[key]; +//=> '/usr/local/bin:/usr/bin:/bin' +``` + + +## API + +### pathKey([options]) + +#### options + +##### env + +Type: `Object`<br> +Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env) + +Use a custom environment variables object. + +#### platform + +Type: `string`<br> +Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform) + +Get the PATH key for a specific platform. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/package.json new file mode 100644 index 0000000000..3dce00f964 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/package.json @@ -0,0 +1,45 @@ +{ + "_from": "npm-run-path@^2.0.0", + "_id": "npm-run-path@2.0.2", + "_inBundle": false, + "_integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "_location": "/libnpx/yargs/os-locale/execa/npm-run-path", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "npm-run-path@^2.0.0", + "name": "npm-run-path", + "escapedName": "npm-run-path", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale/execa" + ], + "_resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "_shasum": "35a9232dfa35d7067b4cb2ddf2357b1871536c5f", + "_shrinkwrap": null, + "_spec": "npm-run-path@^2.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa", + "bin": null, + "bundleDependencies": false, + "dependencies": { + "path-key": "^2.0.0" + }, + "deprecated": false, + "description": "> Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "name": "npm-run-path", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "2.0.2" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/readme.md new file mode 100644 index 0000000000..4ff4722a6c --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/npm-run-path/readme.md @@ -0,0 +1,81 @@ +# npm-run-path [![Build Status](https://travis-ci.org/sindresorhus/npm-run-path.svg?branch=master)](https://travis-ci.org/sindresorhus/npm-run-path) + +> Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries + +In [npm run scripts](https://docs.npmjs.com/cli/run-script) you can execute locally installed binaries by name. This enables the same outside npm. + + +## Install + +``` +$ npm install --save npm-run-path +``` + + +## Usage + +```js +const childProcess = require('child_process'); +const npmRunPath = require('npm-run-path'); + +console.log(process.env.PATH); +//=> '/usr/local/bin' + +console.log(npmRunPath()); +//=> '/Users/sindresorhus/dev/foo/node_modules/.bin:/Users/sindresorhus/dev/node_modules/.bin:/Users/sindresorhus/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/usr/local/bin' + +// `foo` is a locally installed binary +childProcess.execFileSync('foo', { + env: npmRunPath.env() +}); +``` + + +## API + +### npmRunPath([options]) + +#### options + +##### cwd + +Type: `string`<br> +Default: `process.cwd()` + +Working directory. + +##### path + +Type: `string`<br> +Default: [`PATH`](https://github.com/sindresorhus/path-key) + +PATH to be appended.<br> +Set it to an empty string to exclude the default PATH. + +### npmRunPath.env([options]) + +#### options + +##### cwd + +Type: `string`<br> +Default: `process.cwd()` + +Working directory. + +##### env + +Type: `Object` + +Accepts an object of environment variables, like `process.env`, and modifies the PATH using the correct [PATH key](https://github.com/sindresorhus/path-key). Use this if you're modifying the PATH for use in the `child_process` options. + + +## Related + +- [npm-run-path-cli](https://github.com/sindresorhus/npm-run-path-cli) - CLI for this module +- [execa](https://github.com/sindresorhus/execa) - Execute a locally installed binary + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/p-finally/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/p-finally/index.js new file mode 100644 index 0000000000..52b7b49c5f --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/p-finally/index.js @@ -0,0 +1,15 @@ +'use strict'; +module.exports = (promise, onFinally) => { + onFinally = onFinally || (() => {}); + + return promise.then( + val => new Promise(resolve => { + resolve(onFinally()); + }).then(() => val), + err => new Promise(resolve => { + resolve(onFinally()); + }).then(() => { + throw err; + }) + ); +}; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/p-finally/license b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/p-finally/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/p-finally/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/p-finally/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/p-finally/package.json new file mode 100644 index 0000000000..5d8ef077e9 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/p-finally/package.json @@ -0,0 +1,43 @@ +{ + "_from": "p-finally@^1.0.0", + "_id": "p-finally@1.0.0", + "_inBundle": false, + "_integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "_location": "/libnpx/yargs/os-locale/execa/p-finally", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "p-finally@^1.0.0", + "name": "p-finally", + "escapedName": "p-finally", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale/execa" + ], + "_resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "_shasum": "3fbcfb15b899a44123b34b6dcc18b724336a2cae", + "_shrinkwrap": null, + "_spec": "p-finally@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa", + "bin": null, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "> [`Promise#finally()`](https://github.com/tc39/proposal-promise-finally) [ponyfill](https://ponyfill.com) - Invoked when the promise is settled regardless of outcome", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "name": "p-finally", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/p-finally/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/p-finally/readme.md new file mode 100644 index 0000000000..09ef36416b --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/p-finally/readme.md @@ -0,0 +1,47 @@ +# p-finally [![Build Status](https://travis-ci.org/sindresorhus/p-finally.svg?branch=master)](https://travis-ci.org/sindresorhus/p-finally) + +> [`Promise#finally()`](https://github.com/tc39/proposal-promise-finally) [ponyfill](https://ponyfill.com) - Invoked when the promise is settled regardless of outcome + +Useful for cleanup. + + +## Install + +``` +$ npm install --save p-finally +``` + + +## Usage + +```js +const pFinally = require('p-finally'); + +const dir = createTempDir(); + +pFinally(write(dir), () => cleanup(dir)); +``` + + +## API + +### pFinally(promise, [onFinally]) + +Returns a `Promise`. + +#### onFinally + +Type: `Function` + +Note: Throwing or returning a rejected promise will reject `promise` with the rejection reason. + + +## Related + +- [p-try](https://github.com/sindresorhus/p-try) - `Promise#try()` ponyfill - Starts a promise chain +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/CHANGELOG.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/CHANGELOG.md new file mode 100644 index 0000000000..e2f70d2250 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/CHANGELOG.md @@ -0,0 +1,27 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +<a name="3.0.1"></a> +## [3.0.1](https://github.com/tapjs/signal-exit/compare/v3.0.0...v3.0.1) (2016-09-08) + + +### Bug Fixes + +* do not listen on SIGBUS, SIGFPE, SIGSEGV and SIGILL ([#40](https://github.com/tapjs/signal-exit/issues/40)) ([5b105fb](https://github.com/tapjs/signal-exit/commit/5b105fb)) + + + +<a name="3.0.0"></a> +# [3.0.0](https://github.com/tapjs/signal-exit/compare/v2.1.2...v3.0.0) (2016-06-13) + + +### Bug Fixes + +* get our test suite running on Windows ([#23](https://github.com/tapjs/signal-exit/issues/23)) ([6f3eda8](https://github.com/tapjs/signal-exit/commit/6f3eda8)) +* hooking SIGPROF was interfering with profilers see [#21](https://github.com/tapjs/signal-exit/issues/21) ([#24](https://github.com/tapjs/signal-exit/issues/24)) ([1248a4c](https://github.com/tapjs/signal-exit/commit/1248a4c)) + + +### BREAKING CHANGES + +* signal-exit no longer wires into SIGPROF diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/LICENSE.txt b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/LICENSE.txt new file mode 100644 index 0000000000..eead04a121 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/LICENSE.txt @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) 2015, 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/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/README.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/README.md new file mode 100644 index 0000000000..8ebccabeca --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/README.md @@ -0,0 +1,40 @@ +# signal-exit + +[![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit) +[![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master) +[![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit) +[![Windows Tests](https://img.shields.io/appveyor/ci/bcoe/signal-exit/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/bcoe/signal-exit) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +When you want to fire an event no matter how a process exits: + +* reaching the end of execution. +* explicitly having `process.exit(code)` called. +* having `process.kill(pid, sig)` called. +* receiving a fatal signal from outside the process + +Use `signal-exit`. + +```js +var onExit = require('signal-exit') + +onExit(function (code, signal) { + console.log('process exited!') +}) +``` + +## API + +`var remove = onExit(function (code, signal) {}, options)` + +The return value of the function is a function that will remove the +handler. + +Note that the function *only* fires for signals if the signal would +cause the proces to exit. That is, there are no other listeners, and +it is a fatal signal. + +## Options + +* `alwaysLast`: Run this handler after any other signal or exit + handlers. This causes `process.emit` to be monkeypatched. diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/index.js new file mode 100644 index 0000000000..337f691ed2 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/index.js @@ -0,0 +1,157 @@ +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +var assert = require('assert') +var signals = require('./signals.js') + +var EE = require('events') +/* istanbul ignore if */ +if (typeof EE !== 'function') { + EE = EE.EventEmitter +} + +var emitter +if (process.__signal_exit_emitter__) { + emitter = process.__signal_exit_emitter__ +} else { + emitter = process.__signal_exit_emitter__ = new EE() + emitter.count = 0 + emitter.emitted = {} +} + +// Because this emitter is a global, we have to check to see if a +// previous version of this library failed to enable infinite listeners. +// I know what you're about to say. But literally everything about +// signal-exit is a compromise with evil. Get used to it. +if (!emitter.infinite) { + emitter.setMaxListeners(Infinity) + emitter.infinite = true +} + +module.exports = function (cb, opts) { + assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') + + if (loaded === false) { + load() + } + + var ev = 'exit' + if (opts && opts.alwaysLast) { + ev = 'afterexit' + } + + var remove = function () { + emitter.removeListener(ev, cb) + if (emitter.listeners('exit').length === 0 && + emitter.listeners('afterexit').length === 0) { + unload() + } + } + emitter.on(ev, cb) + + return remove +} + +module.exports.unload = unload +function unload () { + if (!loaded) { + return + } + loaded = false + + signals.forEach(function (sig) { + try { + process.removeListener(sig, sigListeners[sig]) + } catch (er) {} + }) + process.emit = originalProcessEmit + process.reallyExit = originalProcessReallyExit + emitter.count -= 1 +} + +function emit (event, code, signal) { + if (emitter.emitted[event]) { + return + } + emitter.emitted[event] = true + emitter.emit(event, code, signal) +} + +// { <signal>: <listener fn>, ... } +var sigListeners = {} +signals.forEach(function (sig) { + sigListeners[sig] = function listener () { + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + var listeners = process.listeners(sig) + if (listeners.length === emitter.count) { + unload() + emit('exit', null, sig) + /* istanbul ignore next */ + emit('afterexit', null, sig) + /* istanbul ignore next */ + process.kill(process.pid, sig) + } + } +}) + +module.exports.signals = function () { + return signals +} + +module.exports.load = load + +var loaded = false + +function load () { + if (loaded) { + return + } + loaded = true + + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + emitter.count += 1 + + signals = signals.filter(function (sig) { + try { + process.on(sig, sigListeners[sig]) + return true + } catch (er) { + return false + } + }) + + process.emit = processEmit + process.reallyExit = processReallyExit +} + +var originalProcessReallyExit = process.reallyExit +function processReallyExit (code) { + process.exitCode = code || 0 + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + /* istanbul ignore next */ + originalProcessReallyExit.call(process, process.exitCode) +} + +var originalProcessEmit = process.emit +function processEmit (ev, arg) { + if (ev === 'exit') { + if (arg !== undefined) { + process.exitCode = arg + } + var ret = originalProcessEmit.apply(this, arguments) + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + return ret + } else { + return originalProcessEmit.apply(this, arguments) + } +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/package.json new file mode 100644 index 0000000000..4e31d03fc0 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/package.json @@ -0,0 +1,44 @@ +{ + "_from": "signal-exit@^3.0.0", + "_id": "signal-exit@3.0.2", + "_inBundle": false, + "_integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "_location": "/libnpx/yargs/os-locale/execa/signal-exit", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "signal-exit@^3.0.0", + "name": "signal-exit", + "escapedName": "signal-exit", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale/execa" + ], + "_resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "_shasum": "b5fdc08f1287ea1178628e415e25132b73646c6d", + "_shrinkwrap": null, + "_spec": "signal-exit@^3.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa", + "bin": null, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "[![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit) [![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master) [![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit) [![Windows Tests](https://img.shields.io/appveyor/ci/bcoe/signal-exit/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/bcoe/signal-exit) [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^2.11.10", + "nyc": "^8.1.0", + "standard": "^7.1.2", + "standard-version": "^2.3.0", + "tap": "^8.0.1" + }, + "name": "signal-exit", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "3.0.2" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/signals.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/signals.js new file mode 100644 index 0000000000..3bd67a8a55 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/signal-exit/signals.js @@ -0,0 +1,53 @@ +// This is not the set of all possible signals. +// +// It IS, however, the set of all signals that trigger +// an exit on either Linux or BSD systems. Linux is a +// superset of the signal names supported on BSD, and +// the unknown signals just fail to register, so we can +// catch that easily enough. +// +// Don't bother with SIGKILL. It's uncatchable, which +// means that we can't fire any callbacks anyway. +// +// If a user does happen to register a handler on a non- +// fatal signal like SIGWINCH or something, and then +// exit, it'll end up firing `process.emit('exit')`, so +// the handler will be fired anyway. +// +// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised +// artificially, inherently leave the process in a +// state from which it is not safe to try and enter JS +// listeners. +module.exports = [ + 'SIGABRT', + 'SIGALRM', + 'SIGHUP', + 'SIGINT', + 'SIGTERM' +] + +if (process.platform !== 'win32') { + module.exports.push( + 'SIGVTALRM', + 'SIGXCPU', + 'SIGXFSZ', + 'SIGUSR2', + 'SIGTRAP', + 'SIGSYS', + 'SIGQUIT', + 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ) +} + +if (process.platform === 'linux') { + module.exports.push( + 'SIGIO', + 'SIGPOLL', + 'SIGPWR', + 'SIGSTKFLT', + 'SIGUNUSED' + ) +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/strip-eof/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/strip-eof/index.js new file mode 100644 index 0000000000..a17d0afd33 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/strip-eof/index.js @@ -0,0 +1,15 @@ +'use strict'; +module.exports = function (x) { + var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt(); + var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt(); + + if (x[x.length - 1] === lf) { + x = x.slice(0, x.length - 1); + } + + if (x[x.length - 1] === cr) { + x = x.slice(0, x.length - 1); + } + + return x; +}; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/strip-eof/license b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/strip-eof/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/strip-eof/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/strip-eof/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/strip-eof/package.json new file mode 100644 index 0000000000..2a5c766d73 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/strip-eof/package.json @@ -0,0 +1,43 @@ +{ + "_from": "strip-eof@^1.0.0", + "_id": "strip-eof@1.0.0", + "_inBundle": false, + "_integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "_location": "/libnpx/yargs/os-locale/execa/strip-eof", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "strip-eof@^1.0.0", + "name": "strip-eof", + "escapedName": "strip-eof", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale/execa" + ], + "_resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "_shasum": "bb43ff5598a6eb05d89b59fcd129c983313606bf", + "_shrinkwrap": null, + "_spec": "strip-eof@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa", + "bin": null, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "> Strip the [End-Of-File](https://en.wikipedia.org/wiki/End-of-file) (EOF) character from a string/buffer", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "name": "strip-eof", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/strip-eof/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/strip-eof/readme.md new file mode 100644 index 0000000000..45ffe04362 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/node_modules/strip-eof/readme.md @@ -0,0 +1,28 @@ +# strip-eof [![Build Status](https://travis-ci.org/sindresorhus/strip-eof.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-eof) + +> Strip the [End-Of-File](https://en.wikipedia.org/wiki/End-of-file) (EOF) character from a string/buffer + + +## Install + +``` +$ npm install --save strip-eof +``` + + +## Usage + +```js +const stripEof = require('strip-eof'); + +stripEof('foo\nbar\n\n'); +//=> 'foo\nbar\n' + +stripEof(new Buffer('foo\nbar\n\n')).toString(); +//=> 'foo\nbar\n' +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/package.json new file mode 100644 index 0000000000..1bceaf633b --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/package.json @@ -0,0 +1,59 @@ +{ + "_from": "execa@^0.5.0", + "_id": "execa@0.5.1", + "_inBundle": false, + "_integrity": "sha1-3j+4XLjW6RyFvLzrFkWBeFy1ezY=", + "_location": "/libnpx/yargs/os-locale/execa", + "_phantomChildren": { + "lru-cache": "4.1.1", + "which": "1.2.14" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "execa@^0.5.0", + "name": "execa", + "escapedName": "execa", + "rawSpec": "^0.5.0", + "saveSpec": null, + "fetchSpec": "^0.5.0" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale" + ], + "_resolved": "https://registry.npmjs.org/execa/-/execa-0.5.1.tgz", + "_shasum": "de3fb85cb8d6e91c85bcbceb164581785cb57b36", + "_shrinkwrap": null, + "_spec": "execa@^0.5.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale", + "bin": null, + "bundleDependencies": false, + "dependencies": { + "cross-spawn": "^4.0.0", + "get-stream": "^2.2.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "deprecated": false, + "description": "> A better [`child_process`](https://nodejs.org/api/child_process.html)", + "devDependencies": { + "ava": "*", + "cat-names": "^1.0.2", + "coveralls": "^2.11.9", + "delay": "^1.3.1", + "is-running": "^2.0.0", + "nyc": "^8.3.0", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "name": "execa", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "0.5.1" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/readme.md new file mode 100644 index 0000000000..16189acb27 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/execa/readme.md @@ -0,0 +1,150 @@ +# execa [![Build Status: Linux](https://travis-ci.org/sindresorhus/execa.svg?branch=master)](https://travis-ci.org/sindresorhus/execa) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/x5ajamxtjtt93cqv/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/execa/branch/master) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/execa/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/execa?branch=master) + +> A better [`child_process`](https://nodejs.org/api/child_process.html) + + +## Why + +- Promise interface. +- [Strips EOF](https://github.com/sindresorhus/strip-eof) from the output so you don't have to `stdout.trim()`. +- Supports [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) binaries cross-platform. +- [Improved Windows support.](https://github.com/IndigoUnited/node-cross-spawn#why) +- Higher max buffer. 10 MB instead of 200 KB. +- [Executes locally installed binaries by name.](#preferlocal) +- [Cleans up spawned processes when the parent process dies.](#cleanup) + + +## Install + +``` +$ npm install --save execa +``` + + +## Usage + +```js +const execa = require('execa'); + +execa('echo', ['unicorns']).then(result => { + console.log(result.stdout); + //=> 'unicorns' +}); + +// pipe the child process stdout to the current stdout +execa('echo', ['unicorns']).stdout.pipe(process.stdout); + +execa.shell('echo unicorns').then(result => { + console.log(result.stdout); + //=> 'unicorns' +}); + +// example of catching an error +execa.shell('exit 3').catch(error => { + console.log(error); + /* + { + message: 'Command failed: /bin/sh -c exit 3' + killed: false, + code: 3, + signal: null, + cmd: '/bin/sh -c exit 3', + stdout: '', + stderr: '', + timedOut: false + } + */ +}); +``` + + +## API + +### execa(file, [arguments], [options]) + +Execute a file. + +Same options as [`child_process.execFile`](https://nodejs.org/api/child_process.html#child_process_child_process_execfile_file_args_options_callback). + +Think of this as a mix of `child_process.execFile` and `child_process.spawn`. + +Returns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties. + +### execa.stdout(file, [arguments], [options]) + +Same as `execa()`, but returns only `stdout`. + +### execa.stderr(file, [arguments], [options]) + +Same as `execa()`, but returns only `stderr`. + +### execa.shell(command, [options]) + +Execute a command through the system shell. Prefer `execa()` whenever possible, as it's both faster and safer. + +Same options as [`child_process.exec`](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback). + +Returns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess). + +The `child_process` instance is enhanced to also be promise for a result object with `stdout` and `stderr` properties. + +### execa.sync(file, [arguments], [options]) + +Execute a file synchronously. + +Same options as [`child_process.execFileSync`](https://nodejs.org/api/child_process.html#child_process_child_process_execfilesync_file_args_options), except the default encoding is `utf8` instead of `buffer`. + +Returns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options). + +### execa.shellSync(file, [options]) + +Execute a command synchronously through the system shell. + +Same options as [`child_process.execSync`](https://nodejs.org/api/child_process.html#child_process_child_process_execsync_command_options), except the default encoding is `utf8` instead of `buffer`. + +Returns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options). + +### options + +Additional options: + +#### stripEof + +Type: `boolean`<br> +Default: `true` + +[Strip EOF](https://github.com/sindresorhus/strip-eof) (last newline) from the output. + +#### preferLocal + +Type: `boolean`<br> +Default: `true` + +Prefer locally installed binaries when looking for a binary to execute.<br> +If you `$ npm install foo`, you can then `execa('foo')`. + +#### input + +Type: `string` `Buffer` `ReadableStream` + +Write some input to the `stdin` of your binary.<br> +Streams are not allowed when using the synchronous methods. + +#### reject + +Type: `boolean`<br> +Default: `true` + +Setting this to `false` resolves the promise with the error instead of rejecting it. + +#### cleanup + +Type: `boolean`<br> +Default: `true` + +Keep track of the spawned process and `kill` it when the parent process exits. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/index.js new file mode 100644 index 0000000000..69bd3d231e --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/index.js @@ -0,0 +1,22 @@ +'use strict'; +var invertKv = require('invert-kv'); +var all = require('./lcid.json'); +var inverted = invertKv(all); + +exports.from = function (lcidCode) { + if (typeof lcidCode !== 'number') { + throw new TypeError('Expected a number'); + } + + return inverted[lcidCode]; +}; + +exports.to = function (localeId) { + if (typeof localeId !== 'string') { + throw new TypeError('Expected a string'); + } + + return all[localeId]; +}; + +exports.all = all; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/lcid.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/lcid.json new file mode 100644 index 0000000000..9c89f6a496 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/lcid.json @@ -0,0 +1,203 @@ +{ + "af_ZA": 1078, + "am_ET": 1118, + "ar_AE": 14337, + "ar_BH": 15361, + "ar_DZ": 5121, + "ar_EG": 3073, + "ar_IQ": 2049, + "ar_JO": 11265, + "ar_KW": 13313, + "ar_LB": 12289, + "ar_LY": 4097, + "ar_MA": 6145, + "ar_OM": 8193, + "ar_QA": 16385, + "ar_SA": 1025, + "ar_SY": 10241, + "ar_TN": 7169, + "ar_YE": 9217, + "arn_CL": 1146, + "as_IN": 1101, + "az_AZ": 2092, + "ba_RU": 1133, + "be_BY": 1059, + "bg_BG": 1026, + "bn_IN": 1093, + "bo_BT": 2129, + "bo_CN": 1105, + "br_FR": 1150, + "bs_BA": 8218, + "ca_ES": 1027, + "co_FR": 1155, + "cs_CZ": 1029, + "cy_GB": 1106, + "da_DK": 1030, + "de_AT": 3079, + "de_CH": 2055, + "de_DE": 1031, + "de_LI": 5127, + "de_LU": 4103, + "div_MV": 1125, + "dsb_DE": 2094, + "el_GR": 1032, + "en_AU": 3081, + "en_BZ": 10249, + "en_CA": 4105, + "en_CB": 9225, + "en_GB": 2057, + "en_IE": 6153, + "en_IN": 18441, + "en_JA": 8201, + "en_MY": 17417, + "en_NZ": 5129, + "en_PH": 13321, + "en_TT": 11273, + "en_US": 1033, + "en_ZA": 7177, + "en_ZW": 12297, + "es_AR": 11274, + "es_BO": 16394, + "es_CL": 13322, + "es_CO": 9226, + "es_CR": 5130, + "es_DO": 7178, + "es_EC": 12298, + "es_ES": 3082, + "es_GT": 4106, + "es_HN": 18442, + "es_MX": 2058, + "es_NI": 19466, + "es_PA": 6154, + "es_PE": 10250, + "es_PR": 20490, + "es_PY": 15370, + "es_SV": 17418, + "es_UR": 14346, + "es_US": 21514, + "es_VE": 8202, + "et_EE": 1061, + "eu_ES": 1069, + "fa_IR": 1065, + "fi_FI": 1035, + "fil_PH": 1124, + "fo_FO": 1080, + "fr_BE": 2060, + "fr_CA": 3084, + "fr_CH": 4108, + "fr_FR": 1036, + "fr_LU": 5132, + "fr_MC": 6156, + "fy_NL": 1122, + "ga_IE": 2108, + "gbz_AF": 1164, + "gl_ES": 1110, + "gsw_FR": 1156, + "gu_IN": 1095, + "ha_NG": 1128, + "he_IL": 1037, + "hi_IN": 1081, + "hr_BA": 4122, + "hr_HR": 1050, + "hu_HU": 1038, + "hy_AM": 1067, + "id_ID": 1057, + "ii_CN": 1144, + "is_IS": 1039, + "it_CH": 2064, + "it_IT": 1040, + "iu_CA": 2141, + "ja_JP": 1041, + "ka_GE": 1079, + "kh_KH": 1107, + "kk_KZ": 1087, + "kl_GL": 1135, + "kn_IN": 1099, + "ko_KR": 1042, + "kok_IN": 1111, + "ky_KG": 1088, + "lb_LU": 1134, + "lo_LA": 1108, + "lt_LT": 1063, + "lv_LV": 1062, + "mi_NZ": 1153, + "mk_MK": 1071, + "ml_IN": 1100, + "mn_CN": 2128, + "mn_MN": 1104, + "moh_CA": 1148, + "mr_IN": 1102, + "ms_BN": 2110, + "ms_MY": 1086, + "mt_MT": 1082, + "my_MM": 1109, + "nb_NO": 1044, + "ne_NP": 1121, + "nl_BE": 2067, + "nl_NL": 1043, + "nn_NO": 2068, + "ns_ZA": 1132, + "oc_FR": 1154, + "or_IN": 1096, + "pa_IN": 1094, + "pl_PL": 1045, + "ps_AF": 1123, + "pt_BR": 1046, + "pt_PT": 2070, + "qut_GT": 1158, + "quz_BO": 1131, + "quz_EC": 2155, + "quz_PE": 3179, + "rm_CH": 1047, + "ro_RO": 1048, + "ru_RU": 1049, + "rw_RW": 1159, + "sa_IN": 1103, + "sah_RU": 1157, + "se_FI": 3131, + "se_NO": 1083, + "se_SE": 2107, + "si_LK": 1115, + "sk_SK": 1051, + "sl_SI": 1060, + "sma_NO": 6203, + "sma_SE": 7227, + "smj_NO": 4155, + "smj_SE": 5179, + "smn_FI": 9275, + "sms_FI": 8251, + "sq_AL": 1052, + "sr_BA": 7194, + "sr_SP": 3098, + "sv_FI": 2077, + "sv_SE": 1053, + "sw_KE": 1089, + "syr_SY": 1114, + "ta_IN": 1097, + "te_IN": 1098, + "tg_TJ": 1064, + "th_TH": 1054, + "tk_TM": 1090, + "tmz_DZ": 2143, + "tn_ZA": 1074, + "tr_TR": 1055, + "tt_RU": 1092, + "ug_CN": 1152, + "uk_UA": 1058, + "ur_IN": 2080, + "ur_PK": 1056, + "uz_UZ": 2115, + "vi_VN": 1066, + "wen_DE": 1070, + "wo_SN": 1160, + "xh_ZA": 1076, + "yo_NG": 1130, + "zh_CHS": 4, + "zh_CHT": 31748, + "zh_CN": 2052, + "zh_HK": 3076, + "zh_MO": 5124, + "zh_SG": 4100, + "zh_TW": 1028, + "zu_ZA": 1077 +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/license b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/node_modules/invert-kv/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/node_modules/invert-kv/index.js new file mode 100644 index 0000000000..61e2196112 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/node_modules/invert-kv/index.js @@ -0,0 +1,15 @@ +'use strict'; +module.exports = function (obj) { + if (typeof obj !== 'object') { + throw new TypeError('Expected an object'); + } + + var ret = {}; + + for (var key in obj) { + var val = obj[key]; + ret[val] = key; + } + + return ret; +}; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/node_modules/invert-kv/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/node_modules/invert-kv/package.json new file mode 100644 index 0000000000..f21e865eff --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/node_modules/invert-kv/package.json @@ -0,0 +1,42 @@ +{ + "_from": "invert-kv@^1.0.0", + "_id": "invert-kv@1.0.0", + "_inBundle": false, + "_integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "_location": "/libnpx/yargs/os-locale/lcid/invert-kv", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "invert-kv@^1.0.0", + "name": "invert-kv", + "escapedName": "invert-kv", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale/lcid" + ], + "_resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "_shasum": "104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6", + "_shrinkwrap": null, + "_spec": "invert-kv@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid", + "bin": null, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "> Invert the key/value of an object. Example: `{foo: 'bar'}` → `{bar: 'foo'}`", + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "name": "invert-kv", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/node_modules/invert-kv/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/node_modules/invert-kv/readme.md new file mode 100644 index 0000000000..039fc7cfa2 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/node_modules/invert-kv/readme.md @@ -0,0 +1,25 @@ +# invert-kv [![Build Status](https://travis-ci.org/sindresorhus/invert-kv.svg?branch=master)](https://travis-ci.org/sindresorhus/invert-kv) + +> Invert the key/value of an object. Example: `{foo: 'bar'}` → `{bar: 'foo'}` + + +## Install + +```sh +$ npm install --save invert-kv +``` + + +## Usage + +```js +var invertKv = require('invert-kv'); + +invertKv({foo: 'bar', unicorn: 'rainbow'}); +//=> {bar: 'foo', rainbow: 'unicorn'} +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/package.json new file mode 100644 index 0000000000..6aa2fabe96 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/package.json @@ -0,0 +1,44 @@ +{ + "_from": "lcid@^1.0.0", + "_id": "lcid@1.0.0", + "_inBundle": false, + "_integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "_location": "/libnpx/yargs/os-locale/lcid", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "lcid@^1.0.0", + "name": "lcid", + "escapedName": "lcid", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale" + ], + "_resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "_shasum": "308accafa0bc483a3867b4b6f2b9506251d1b835", + "_shrinkwrap": null, + "_spec": "lcid@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale", + "bin": null, + "bundleDependencies": false, + "dependencies": { + "invert-kv": "^1.0.0" + }, + "deprecated": false, + "description": "> Mapping between [standard locale identifiers](http://en.wikipedia.org/wiki/Locale) and [Windows locale identifiers (LCID)](http://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms)", + "devDependencies": { + "ava": "0.0.4" + }, + "engines": { + "node": ">=0.10.0" + }, + "name": "lcid", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/readme.md new file mode 100644 index 0000000000..bee4a70166 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/lcid/readme.md @@ -0,0 +1,35 @@ +# lcid [![Build Status](https://travis-ci.org/sindresorhus/lcid.svg?branch=master)](https://travis-ci.org/sindresorhus/lcid) + +> Mapping between [standard locale identifiers](http://en.wikipedia.org/wiki/Locale) and [Windows locale identifiers (LCID)](http://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms) + +Based on the [mapping](https://github.com/python/cpython/blob/be2a1a76fa43bb1ea1b3577bb5bdd506a2e90e37/Lib/locale.py#L1395-L1604) used in the Python standard library. + +The mapping itself is just a [JSON file](lcid.json) and can be used wherever. + + +## Install + +``` +$ npm install --save lcid +``` + + +## Usage + +```js +var lcid = require('lcid'); + +lcid.from(1044); +//=> 'nb_NO' + +lcid.to('nb_NO'); +//=> 1044 + +lcid.all; +//=> {'af_ZA': 1078, ...} +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/index.js new file mode 100644 index 0000000000..aa5a073982 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/index.js @@ -0,0 +1,55 @@ +'use strict'; +const mimicFn = require('mimic-fn'); + +const cacheStore = new WeakMap(); + +const defaultCacheKey = function (x) { + if (arguments.length === 1 && (x === null || x === undefined || (typeof x !== 'function' && typeof x !== 'object'))) { + return x; + } + + return JSON.stringify(arguments); +}; + +module.exports = (fn, opts) => { + opts = Object.assign({ + cacheKey: defaultCacheKey, + cache: new Map() + }, opts); + + const memoized = function () { + const cache = cacheStore.get(memoized); + const key = opts.cacheKey.apply(null, arguments); + + if (cache.has(key)) { + const c = cache.get(key); + + if (typeof opts.maxAge !== 'number' || Date.now() < c.maxAge) { + return c.data; + } + } + + const ret = fn.apply(null, arguments); + + cache.set(key, { + data: ret, + maxAge: Date.now() + (opts.maxAge || 0) + }); + + return ret; + }; + + mimicFn(memoized, fn); + + cacheStore.set(memoized, opts.cache); + + return memoized; +}; + +module.exports.clear = fn => { + const cache = cacheStore.get(fn); + + if (cache && typeof cache.clear === 'function') { + cache.clear(); + } +}; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/license b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/node_modules/mimic-fn/index.js b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/node_modules/mimic-fn/index.js new file mode 100644 index 0000000000..9bf1763673 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/node_modules/mimic-fn/index.js @@ -0,0 +1,7 @@ +'use strict'; +module.exports = (to, from) => { + // TODO: use `Reflect.ownKeys()` when targeting Node.js 6 + for (const prop of Object.getOwnPropertyNames(from).concat(Object.getOwnPropertySymbols(from))) { + Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); + } +}; diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/node_modules/mimic-fn/license b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/node_modules/mimic-fn/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/node_modules/mimic-fn/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/node_modules/mimic-fn/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/node_modules/mimic-fn/package.json new file mode 100644 index 0000000000..f3099fa5f1 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/node_modules/mimic-fn/package.json @@ -0,0 +1,43 @@ +{ + "_from": "mimic-fn@^1.0.0", + "_id": "mimic-fn@1.1.0", + "_inBundle": false, + "_integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=", + "_location": "/libnpx/yargs/os-locale/mem/mimic-fn", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "mimic-fn@^1.0.0", + "name": "mimic-fn", + "escapedName": "mimic-fn", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale/mem" + ], + "_resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", + "_shasum": "e667783d92e89dbd342818b5230b9d62a672ad18", + "_shrinkwrap": null, + "_spec": "mimic-fn@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem", + "bin": null, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "> Make a function mimic another one", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "name": "mimic-fn", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/node_modules/mimic-fn/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/node_modules/mimic-fn/readme.md new file mode 100644 index 0000000000..672c79eb3a --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/node_modules/mimic-fn/readme.md @@ -0,0 +1,66 @@ +# mimic-fn [![Build Status](https://travis-ci.org/sindresorhus/mimic-fn.svg?branch=master)](https://travis-ci.org/sindresorhus/mimic-fn) + +> Make a function mimic another one + +Useful when you wrap a function in another function and like to preserve the original name and other properties. + + +## Install + +``` +$ npm install --save mimic-fn +``` + + +## Usage + +```js +const mimicFn = require('mimic-fn'); + +function foo() {} +foo.unicorn = '🦄'; + +function wrapper() { + return foo() {}; +} + +console.log(wrapper.name); +//=> 'wrapper' + +mimicFn(wrapper, foo); + +console.log(wrapper.name); +//=> 'foo' + +console.log(wrapper.unicorn); +//=> '🦄' +``` + + +## API + +It will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set. + +### mimicFn(to, from) + +#### to + +Type: `Function` + +Mimicking function. + +#### from + +Type: `Function` + +Function to mimic. + + +## Related + +- [rename-fn](https://github.com/sindresorhus/rename-fn) - Rename a function + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/package.json b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/package.json new file mode 100644 index 0000000000..b0badad600 --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/package.json @@ -0,0 +1,46 @@ +{ + "_from": "mem@^1.1.0", + "_id": "mem@1.1.0", + "_inBundle": false, + "_integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "_location": "/libnpx/yargs/os-locale/mem", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "mem@^1.1.0", + "name": "mem", + "escapedName": "mem", + "rawSpec": "^1.1.0", + "saveSpec": null, + "fetchSpec": "^1.1.0" + }, + "_requiredBy": [ + "/libnpx/yargs/os-locale" + ], + "_resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "_shasum": "5edd52b485ca1d900fe64895505399a0dfa45f76", + "_shrinkwrap": null, + "_spec": "mem@^1.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale", + "bin": null, + "bundleDependencies": false, + "dependencies": { + "mimic-fn": "^1.0.0" + }, + "deprecated": false, + "description": "> [Memoize](https://en.wikipedia.org/wiki/Memoization) functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", + "devDependencies": { + "ava": "*", + "delay": "^1.1.0", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "name": "mem", + "optionalDependencies": {}, + "peerDependencies": {}, + "scripts": {}, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/readme.md b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/readme.md new file mode 100644 index 0000000000..7ebab84f0e --- /dev/null +++ b/deps/npm/node_modules/libnpx/node_modules/yargs/node_modules/os-locale/node_modules/mem/readme.md @@ -0,0 +1,147 @@ +# mem [![Build Status](https://travis-ci.org/sindresorhus/mem.svg?branch=master)](https://travis-ci.org/sindresorhus/mem) + +> [Memoize](https://en.wikipedia.org/wiki/Memoization) functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input + + +## Install + +``` +$ npm install --save mem +``` + + +## Usage + +```js +const mem = require('mem'); + +let i = 0; +const counter = () => ++i; +const memoized = mem(counter); + +memoized('foo'); +//=> 1 + +// cached as it's the same arguments +memoized('foo'); +//=> 1 + +// not cached anymore as the arguments changed +memoized('bar'); +//=> 2 + +memoized('bar'); +//=> 2 +``` + +##### Works fine with promise returning functions + +```js +const mem = require('mem'); + +let i = 0; +const counter = () => Promise.resolve(++i); +const memoized = mem(counter); + +memoized().then(a => { + console.log(a); + //=> 1 + + memoized().then(b => { + // the return value didn't increase as it's cached + console.log(b); + //=> 1 + }); +}); +``` + +```js +const mem = require('mem'); +const got = require('got'); +const memGot = mem(got, {maxAge: 1000}); + +memGot('sindresorhus.com').then(() => { + // this call is cached + memGot('sindresorhus.com').then(() => { + setTimeout(() => { + // this call is not cached as the cache has expired + memGot('sindresorhus.com').then(() => {}); + }, 2000); + }); +}); +``` + + +## API + +### mem(fn, [options]) + +#### fn + +Type: `Function` + +Function to be memoized. + +#### options + +##### maxAge + +Type: `number`<br> +Default: `Infinity` + +Milliseconds until the cache expires. + +##### cacheKey + +Type: `Function` + +Determines the cache key for storing the result based on the function arguments. By default, if there's only one argument and it's a [primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive), it's used directly as a key, otherwise it's all the function arguments JSON stringified as an array. + +You could for example change it to only cache on the first argument `x => JSON.stringify(x)`. + +##### cache + +Type: `Object`<br> +Default: `new Map()` + +Use a different cache storage. Must implement the following methods: `.has(key)`, `.get(key)`, `.set(key, value)`, and optionally `.clear()`. You could for example use a `WeakMap` instead. + +### mem.clear(fn) + +Clear all cached data of a memoized function. + +#### fn + +Type: `Function` + +Memoized function. + + +## Tips + +### Cache statistics + +If you want to know how many times your cache had a hit or a miss, you can make use of [stats-map](https://github.com/SamVerschueren/stats-map) as a replacement for the default cache. + +#### Example + +```js +const mem = require('mem'); +const StatsMap = require('stats-map'); +const got = require('got'); + +const cache = new StatsMap(); +const memGot = mem(got, {cache}); + +memGot('sindresorhus.com') + .then(() => memGot('sindresorhus.com')) + .then(() => memGot('sindresorhus.com')); + +console.log(cache.stats); +//=> {hits: 2, misses: 1} +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) |