Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

term-size

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

term-size - npm Package Compare versions

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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc