Commit project
This commit is contained in:
parent
28471965a0
commit
3ac017a5ad
1030 changed files with 94062 additions and 0 deletions
70
node_modules/term-size/index.js
generated
vendored
Normal file
70
node_modules/term-size/index.js
generated
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
'use strict';
|
||||
const path = require('path');
|
||||
const execa = require('execa');
|
||||
|
||||
const create = (columns, rows) => ({
|
||||
columns: parseInt(columns, 10),
|
||||
rows: parseInt(rows, 10)
|
||||
});
|
||||
|
||||
module.exports = () => {
|
||||
const env = process.env;
|
||||
const stdout = process.stdout;
|
||||
const stderr = process.stderr;
|
||||
|
||||
if (stdout && stdout.columns && stdout.rows) {
|
||||
return create(stdout.columns, stdout.rows);
|
||||
}
|
||||
|
||||
if (stderr && stderr.columns && stderr.rows) {
|
||||
return create(stderr.columns, stderr.rows);
|
||||
}
|
||||
|
||||
// These values are static, so not the first choice
|
||||
if (env.COLUMNS && env.LINES) {
|
||||
return create(env.COLUMNS, env.LINES);
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
try {
|
||||
// Binary: https://github.com/sindresorhus/win-term-size
|
||||
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]);
|
||||
}
|
||||
} catch (err) {}
|
||||
} else {
|
||||
if (process.platform === 'darwin') {
|
||||
try {
|
||||
// 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]);
|
||||
}
|
||||
} catch (err) {}
|
||||
}
|
||||
|
||||
// `resize` is preferred as it works even when all file descriptors are redirected
|
||||
// https://linux.die.net/man/1/resize
|
||||
try {
|
||||
const size = execa.sync('resize', ['-u']).stdout.match(/\d+/g);
|
||||
|
||||
if (size.length === 2) {
|
||||
return create(size[0], size[1]);
|
||||
}
|
||||
} catch (err) {}
|
||||
|
||||
try {
|
||||
const columns = execa.sync('tput', ['cols']).stdout;
|
||||
const rows = execa.sync('tput', ['lines']).stdout;
|
||||
|
||||
if (columns && rows) {
|
||||
return create(columns, rows);
|
||||
}
|
||||
} catch (err) {}
|
||||
}
|
||||
|
||||
return create(80, 24);
|
||||
};
|
21
node_modules/term-size/license
generated
vendored
Normal file
21
node_modules/term-size/license
generated
vendored
Normal file
|
@ -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.
|
79
node_modules/term-size/package.json
generated
vendored
Normal file
79
node_modules/term-size/package.json
generated
vendored
Normal file
|
@ -0,0 +1,79 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"term-size@1.2.0",
|
||||
"/Users/rodrigopinto/Documents/Development/ClusterSystems/cluster-server"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "term-size@1.2.0",
|
||||
"_id": "term-size@1.2.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=",
|
||||
"_location": "/term-size",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "term-size@1.2.0",
|
||||
"name": "term-size",
|
||||
"escapedName": "term-size",
|
||||
"rawSpec": "1.2.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.2.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/boxen"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz",
|
||||
"_spec": "1.2.0",
|
||||
"_where": "/Users/rodrigopinto/Documents/Development/ClusterSystems/cluster-server",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/term-size/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"execa": "^0.7.0"
|
||||
},
|
||||
"description": "Reliably get the terminal window size (columns & rows)",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"vendor"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/term-size#readme",
|
||||
"keywords": [
|
||||
"term",
|
||||
"terminal",
|
||||
"size",
|
||||
"console",
|
||||
"window",
|
||||
"width",
|
||||
"height",
|
||||
"columns",
|
||||
"rows",
|
||||
"lines",
|
||||
"tty",
|
||||
"redirected"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "term-size",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/term-size.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "1.2.0"
|
||||
}
|
41
node_modules/term-size/readme.md
generated
vendored
Normal file
41
node_modules/term-size/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
# term-size [](https://travis-ci.org/sindresorhus/term-size) [](https://ci.appveyor.com/project/sindresorhus/term-size/branch/master)
|
||||
|
||||
> 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. This module even works when all the TTY file descriptors are redirected!
|
||||
|
||||
Confirmed working on macOS, Linux, and Windows.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save term-size
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const termSize = require('term-size');
|
||||
|
||||
termSize();
|
||||
//=> {columns: 143, rows: 24}
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### termSize()
|
||||
|
||||
Returns an `Object` with `columns` and `rows` properties.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [term-size-cli](https://github.com/sindresorhus/term-size-cli) - CLI for this module
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
BIN
node_modules/term-size/vendor/macos/term-size
generated
vendored
Executable file
BIN
node_modules/term-size/vendor/macos/term-size
generated
vendored
Executable file
Binary file not shown.
BIN
node_modules/term-size/vendor/windows/term-size.exe
generated
vendored
Normal file
BIN
node_modules/term-size/vendor/windows/term-size.exe
generated
vendored
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue