Comparing version 3.0.1 to 3.0.2
11
index.js
@@ -6,7 +6,10 @@ import process from 'node:process'; | ||
const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
const exec = (command, arguments_, shell) => | ||
execFileSync(command, arguments_, {encoding: 'utf8', shell, stdio: ['ignore', 'pipe', 'ignore']}).trim(); | ||
function execNative(command, shell) { | ||
const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
return exec(path.join(__dirname, command), [], shell).split(/\r?\n/); | ||
} | ||
const create = (columns, rows) => ({ | ||
@@ -36,3 +39,3 @@ columns: Number.parseInt(columns, 10), | ||
// Binary: https://github.com/sindresorhus/win-term-size | ||
const size = exec(path.join(__dirname, 'vendor/windows/term-size.exe')).split(/\r?\n/); | ||
const size = execNative('vendor/windows/term-size.exe', false); | ||
@@ -47,3 +50,3 @@ if (size.length === 2) { | ||
// Binary: https://github.com/sindresorhus/macos-term-size | ||
const size = exec(path.join(__dirname, 'vendor/macos/term-size'), [], true).split(/\r?\n/); | ||
const size = execNative('vendor/macos/term-size', true); | ||
@@ -50,0 +53,0 @@ if (size.length === 2) { |
{ | ||
"name": "term-size", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Reliably get the terminal window size (columns & rows)", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
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
50175
78