diff options
Diffstat (limited to 'node_modules/term-size')
-rw-r--r-- | node_modules/term-size/index.js | 8 | ||||
-rw-r--r-- | node_modules/term-size/node_modules/execa/index.js | 172 | ||||
-rw-r--r-- | node_modules/term-size/node_modules/execa/license | 21 | ||||
-rw-r--r-- | node_modules/term-size/node_modules/execa/package.json | 62 | ||||
-rw-r--r-- | node_modules/term-size/node_modules/execa/readme.md | 137 | ||||
-rw-r--r-- | node_modules/term-size/node_modules/npm-run-path/index.js | 23 | ||||
-rw-r--r-- | node_modules/term-size/node_modules/npm-run-path/license | 21 | ||||
-rw-r--r-- | node_modules/term-size/node_modules/npm-run-path/package.json | 42 | ||||
-rw-r--r-- | node_modules/term-size/node_modules/npm-run-path/readme.md | 66 | ||||
-rw-r--r-- | node_modules/term-size/package.json | 13 | ||||
-rw-r--r-- | node_modules/term-size/readme.md | 2 | ||||
-rwxr-xr-x | node_modules/term-size/vendor/macos/term-size | bin | 0 -> 8760 bytes | |||
-rwxr-xr-x | node_modules/term-size/vendor/resize | bin | 67056 -> 0 bytes | |||
-rw-r--r-- | node_modules/term-size/vendor/windows/term-size.exe (renamed from node_modules/term-size/vendor/win-term-size.exe) | bin | 17408 -> 17408 bytes |
14 files changed, 10 insertions, 557 deletions
diff --git a/node_modules/term-size/index.js b/node_modules/term-size/index.js index c6974e2e3..95e410df2 100644 --- a/node_modules/term-size/index.js +++ b/node_modules/term-size/index.js @@ -20,7 +20,7 @@ module.exports = () => { return create(stderr.columns, stderr.rows); } - // these values are static, so not the first choice + // These values are static, so not the first choice if (env.COLUMNS && env.LINES) { return create(env.COLUMNS, env.LINES); } @@ -28,7 +28,7 @@ module.exports = () => { if (process.platform === 'win32') { try { // Binary: https://github.com/sindresorhus/win-term-size - const size = execa.sync(path.join(__dirname, 'vendor/win-term-size.exe')).stdout.split(/\r?\n/); + const size = execa.sync(path.join(__dirname, 'vendor/windows/term-size.exe')).stdout.split(/\r?\n/); if (size.length === 2) { return create(size[0], size[1]); @@ -37,8 +37,8 @@ module.exports = () => { } else { if (process.platform === 'darwin') { try { - // Binary is from https://www.xquartz.org - const size = execa.shellSync(path.join(__dirname, 'vendor/resize'), ['-u']).stdout.match(/\d+/g); + // Binary: https://github.com/sindresorhus/macos-term-size + const size = execa.shellSync(path.join(__dirname, 'vendor/macos/term-size')).stdout.split(/\r?\n/); if (size.length === 2) { return create(size[0], size[1]); diff --git a/node_modules/term-size/node_modules/execa/index.js b/node_modules/term-size/node_modules/execa/index.js deleted file mode 100644 index 5f3714a08..000000000 --- a/node_modules/term-size/node_modules/execa/index.js +++ /dev/null @@ -1,172 +0,0 @@ -'use strict'; -var childProcess = require('child_process'); -var crossSpawnAsync = require('cross-spawn-async'); -var stripEof = require('strip-eof'); -var objectAssign = require('object-assign'); -var npmRunPath = require('npm-run-path'); -var isStream = require('is-stream'); -var pathKey = require('path-key')(); -var TEN_MEBIBYTE = 1024 * 1024 * 10; - -function handleArgs(cmd, args, opts) { - var parsed; - - if (opts && opts.__winShell === true) { - delete opts.__winShell; - parsed = { - command: cmd, - args: args, - options: opts, - file: cmd, - original: cmd - }; - } else { - parsed = crossSpawnAsync._parse(cmd, args, opts); - } - - opts = objectAssign({ - maxBuffer: TEN_MEBIBYTE, - stripEof: true, - preferLocal: true, - encoding: 'utf8' - }, parsed.options); - - if (opts.preferLocal) { - opts.env = objectAssign({}, opts.env || process.env); - opts.env[pathKey] = npmRunPath({ - cwd: opts.cwd, - path: opts.env[pathKey] - }); - } - - return { - cmd: parsed.command, - args: parsed.args, - opts: opts - }; -} - -function handleInput(spawned, opts) { - var 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 (opts.stripEof) { - val = stripEof(val); - } - - return val; -} - -function handleShell(fn, cmd, opts) { - var file; - var args; - - opts = objectAssign({}, opts); - - if (process.platform === 'win32') { - opts.__winShell = true; - file = process.env.comspec || 'cmd.exe'; - args = ['/s', '/c', '"' + cmd + '"']; - opts.windowsVerbatimArguments = true; - } else { - file = '/bin/sh'; - args = ['-c', cmd]; - } - - if (opts.shell) { - file = opts.shell; - } - - return fn(file, args, opts); -} - -module.exports = function (cmd, args, opts) { - var spawned; - - var promise = new Promise(function (resolve, reject) { - var parsed = handleArgs(cmd, args, opts); - - spawned = childProcess.execFile(parsed.cmd, parsed.args, parsed.opts, function (err, stdout, stderr) { - if (err) { - err.stdout = stdout; - err.stderr = stderr; - err.message += stdout; - reject(err); - return; - } - - resolve({ - stdout: handleOutput(parsed.opts, stdout), - stderr: handleOutput(parsed.opts, stderr) - }); - }); - - crossSpawnAsync._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(function (x) { - return x.stdout; - }); -}; - -module.exports.stderr = function () { - // TODO: set `stdout: 'ignore'` when that option is implemented - return module.exports.apply(null, arguments).then(function (x) { - return x.stderr; - }); -}; - -module.exports.shell = function (cmd, opts) { - return handleShell(module.exports, cmd, opts); -}; - -module.exports.spawn = function (cmd, args, opts) { - var parsed = handleArgs(cmd, args, opts); - var spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts); - - crossSpawnAsync._enoent.hookChildProcess(spawned, parsed); - - return spawned; -}; - -module.exports.sync = function (cmd, args, opts) { - var parsed = handleArgs(cmd, args, opts); - - if (isStream(parsed.opts.input)) { - throw new TypeError('The `input` option cannot be a stream in sync mode'); - } - - var result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts); - - if (parsed.opts.stripEof) { - result.stdout = stripEof(result.stdout); - result.stderr = stripEof(result.stderr); - } - - return result; -}; - -module.exports.shellSync = function (cmd, opts) { - return handleShell(module.exports.sync, cmd, opts); -}; diff --git a/node_modules/term-size/node_modules/execa/license b/node_modules/term-size/node_modules/execa/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/term-size/node_modules/execa/license +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/term-size/node_modules/execa/package.json b/node_modules/term-size/node_modules/execa/package.json deleted file mode 100644 index 9e0682eee..000000000 --- a/node_modules/term-size/node_modules/execa/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "execa", - "version": "0.4.0", - "description": "A better `child_process`", - "license": "MIT", - "repository": "sindresorhus/execa", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "maintainers": [ - { - "name": "James Talmage", - "email": "james@talmage.io", - "url": "github.com/jamestalmage" - } - ], - "engines": { - "node": ">=0.12" - }, - "scripts": { - "test": "xo && nyc ava", - "coveralls": "nyc report --reporter=text-lcov | coveralls" - }, - "files": [ - "index.js" - ], - "keywords": [ - "exec", - "child", - "process", - "execute", - "fork", - "execfile", - "spawn", - "file", - "shell", - "bin", - "binary", - "binaries", - "npm", - "path", - "local" - ], - "dependencies": { - "cross-spawn-async": "^2.1.1", - "is-stream": "^1.1.0", - "npm-run-path": "^1.0.0", - "object-assign": "^4.0.1", - "path-key": "^1.0.0", - "strip-eof": "^1.0.0" - }, - "devDependencies": { - "ava": "*", - "cat-names": "^1.0.2", - "coveralls": "^2.11.9", - "get-stream": "^2.0.0", - "nyc": "^6.4.0", - "xo": "*" - } -} diff --git a/node_modules/term-size/node_modules/execa/readme.md b/node_modules/term-size/node_modules/execa/readme.md deleted file mode 100644 index 1231e6d8d..000000000 --- a/node_modules/term-size/node_modules/execa/readme.md +++ /dev/null @@ -1,137 +0,0 @@ -# execa [](https://travis-ci.org/sindresorhus/execa) [](https://ci.appveyor.com/project/sindresorhus/execa/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-async#why) -- Higher max buffer. 10 MB instead of 200 KB. -- [Executes locally installed binaries by name.](#preferlocal) - - -## Install - -``` -$ npm install --save execa -``` - - -## Usage - -```js -const execa = require('execa'); - -execa('echo', ['unicorns']).then(result => { - console.log(result.stdout); - //=> 'unicorns' -}); - -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: '' - } - */ -}); -``` - - -## 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). - -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.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.spawn(file, [arguments], [options]) - -Spawn a file. - -Same API as [`child_process.spawn`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options). - -### 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. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/term-size/node_modules/npm-run-path/index.js b/node_modules/term-size/node_modules/npm-run-path/index.js deleted file mode 100644 index 92b8d7dc3..000000000 --- a/node_modules/term-size/node_modules/npm-run-path/index.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; -var path = require('path'); -var pathKey = require('path-key'); - -module.exports = function (opts) { - opts = opts || {}; - - var prev; - var pth = path.resolve(opts.cwd || '.'); - - var 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 || process.env[pathKey()]).join(path.delimiter); -}; diff --git a/node_modules/term-size/node_modules/npm-run-path/license b/node_modules/term-size/node_modules/npm-run-path/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/term-size/node_modules/npm-run-path/license +++ /dev/null @@ -1,21 +0,0 @@ -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/node_modules/term-size/node_modules/npm-run-path/package.json b/node_modules/term-size/node_modules/npm-run-path/package.json deleted file mode 100644 index 4f5ca5cda..000000000 --- a/node_modules/term-size/node_modules/npm-run-path/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "npm-run-path", - "version": "1.0.0", - "description": "Get your PATH prepended with locally installed binaries", - "license": "MIT", - "repository": "sindresorhus/npm-run-path", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "npm", - "run", - "path", - "package", - "bin", - "binary", - "binaries", - "script", - "cli", - "command-line", - "execute", - "executable" - ], - "dependencies": { - "path-key": "^1.0.0" - }, - "devDependencies": { - "ava": "*", - "xo": "*" - } -} diff --git a/node_modules/term-size/node_modules/npm-run-path/readme.md b/node_modules/term-size/node_modules/npm-run-path/readme.md deleted file mode 100644 index da6d13e84..000000000 --- a/node_modules/term-size/node_modules/npm-run-path/readme.md +++ /dev/null @@ -1,66 +0,0 @@ -# npm-run-path [](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: { - PATH: npmRunPath() - } -}); -``` - - -## API - -### npmRunPath([options]) - -#### options - -##### cwd - -Type: `string` -Default: `process.cwd()` - -Working directory. - -##### path - -Type: `string` -Default: [`PATH`](https://github.com/sindresorhus/path-key) - -PATH to be appended.<br> -Set it to an empty string to exclude the default PATH. - - -## 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](http://sindresorhus.com) diff --git a/node_modules/term-size/package.json b/node_modules/term-size/package.json index bd3a150b7..798d7ebc2 100644 --- a/node_modules/term-size/package.json +++ b/node_modules/term-size/package.json @@ -1,7 +1,7 @@ { "name": "term-size", - "version": "0.1.1", - "description": "Reliably get the terminal window size", + "version": "1.2.0", + "description": "Reliably get the terminal window size (columns & rows)", "license": "MIT", "repository": "sindresorhus/term-size", "author": { @@ -30,17 +30,14 @@ "columns", "rows", "lines", - "tty" + "tty", + "redirected" ], "dependencies": { - "execa": "^0.4.0" + "execa": "^0.7.0" }, "devDependencies": { "ava": "*", - "execa": "^0.4.0", "xo": "*" - }, - "xo": { - "esnext": true } } diff --git a/node_modules/term-size/readme.md b/node_modules/term-size/readme.md index a067f8009..dd642cadc 100644 --- a/node_modules/term-size/readme.md +++ b/node_modules/term-size/readme.md @@ -2,7 +2,7 @@ > Reliably get the terminal window size -Because [`process.stdout.columns`](https://nodejs.org/api/tty.html#tty_writestream_columns) doesn't exist when run [non-interactively](http://www.tldp.org/LDP/abs/html/intandnonint.html), for example, in a child process or when piped. +Because [`process.stdout.columns`](https://nodejs.org/api/tty.html#tty_writestream_columns) doesn't exist when run [non-interactively](http://www.tldp.org/LDP/abs/html/intandnonint.html), for example, in a child process or when piped. This module even works when all the TTY file descriptors are redirected! Confirmed working on macOS, Linux, and Windows. diff --git a/node_modules/term-size/vendor/macos/term-size b/node_modules/term-size/vendor/macos/term-size Binary files differnew file mode 100755 index 000000000..e383cc737 --- /dev/null +++ b/node_modules/term-size/vendor/macos/term-size diff --git a/node_modules/term-size/vendor/resize b/node_modules/term-size/vendor/resize Binary files differdeleted file mode 100755 index 476ede4c0..000000000 --- a/node_modules/term-size/vendor/resize +++ /dev/null diff --git a/node_modules/term-size/vendor/win-term-size.exe b/node_modules/term-size/vendor/windows/term-size.exe Binary files differindex c7a170c96..c7a170c96 100644 --- a/node_modules/term-size/vendor/win-term-size.exe +++ b/node_modules/term-size/vendor/windows/term-size.exe |