Comparing version 2.0.0 to 2.1.0
14
index.js
'use strict'; | ||
const {execFileSync} = require('child_process'); | ||
const path = require('path'); | ||
const execa = require('execa'); | ||
const exec = (command, arguments_, shell) => execFileSync(command, arguments_, {encoding: 'utf8', shell}).trim(); | ||
const create = (columns, rows) => ({ | ||
@@ -29,3 +31,3 @@ columns: parseInt(columns, 10), | ||
// Binary: https://github.com/sindresorhus/win-term-size | ||
const size = execa.sync(path.join(__dirname, 'vendor/windows/term-size.exe')).stdout.split(/\r?\n/); | ||
const size = exec(path.join(__dirname, 'vendor/windows/term-size.exe')).split(/\r?\n/); | ||
@@ -40,3 +42,3 @@ if (size.length === 2) { | ||
// Binary: https://github.com/sindresorhus/macos-term-size | ||
const size = execa.shellSync(path.join(__dirname, 'vendor/macos/term-size')).stdout.split(/\r?\n/); | ||
const size = exec(path.join(__dirname, 'vendor/macos/term-size'), [], true).split(/\r?\n/); | ||
@@ -52,3 +54,3 @@ if (size.length === 2) { | ||
try { | ||
const size = execa.sync('resize', ['-u']).stdout.match(/\d+/g); | ||
const size = exec('resize', ['-u']).match(/\d+/g); | ||
@@ -61,4 +63,4 @@ if (size.length === 2) { | ||
try { | ||
const columns = execa.sync('tput', ['cols']).stdout; | ||
const rows = execa.sync('tput', ['lines']).stdout; | ||
const columns = exec('tput', ['cols']); | ||
const rows = exec('tput', ['lines']); | ||
@@ -65,0 +67,0 @@ if (columns && rows) { |
{ | ||
"name": "term-size", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Reliably get the terminal window size (columns & rows)", | ||
@@ -36,10 +36,8 @@ "license": "MIT", | ||
], | ||
"dependencies": { | ||
"execa": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^1.4.1", | ||
"tsd": "^0.7.2", | ||
"execa": "^1.0.0", | ||
"tsd": "^0.7.3", | ||
"xo": "^0.24.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45343
0
73
4
3
- Removedexeca@^1.0.0
- Removedcross-spawn@6.0.5(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedexeca@1.0.0(transitive)
- Removedget-stream@4.1.0(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removednice-try@1.0.5(transitive)
- Removednpm-run-path@2.0.2(transitive)
- Removedonce@1.4.0(transitive)
- Removedp-finally@1.0.0(transitive)
- Removedpath-key@2.0.1(transitive)
- Removedpump@3.0.2(transitive)
- Removedsemver@5.7.2(transitive)
- Removedshebang-command@1.2.0(transitive)
- Removedshebang-regex@1.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedstrip-eof@1.0.0(transitive)
- Removedwhich@1.3.1(transitive)
- Removedwrappy@1.0.2(transitive)