Socket
Socket
Sign inDemoInstall

cli-width

Package Overview
Dependencies
0
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.1 to 2.2.0

10

CHANGELOG.md

@@ -5,3 +5,13 @@ # Change Log

<a name="2.2.0"></a>
# [2.2.0](https://github.com/knownasilya/cli-width/compare/v2.1.1...v2.2.0) (2017-08-22)
### Features
* return default if env is 0 ([1833baf](https://github.com/knownasilya/cli-width/commit/1833baf)), closes [#9](https://github.com/knownasilya/cli-width/issues/9)
<a name="2.1.1"></a>
## [2.1.1](https://github.com/knownasilya/cli-width/compare/v2.1.0...v2.1.1) (2017-08-22)

14

index.js

@@ -11,2 +11,3 @@ 'use strict';

};
if (!options) {

@@ -20,2 +21,3 @@ return defaultOpts;

});
return options;

@@ -27,18 +29,16 @@ }

var opts = normalizeOpts(options);
if (opts.output.getWindowSize) {
return opts.output.getWindowSize()[0] || opts.defaultWidth;
}
else {
} else {
if (opts.tty.getWindowSize) {
return opts.tty.getWindowSize()[1] || opts.defaultWidth;
}
else {
} else {
if (opts.output.columns) {
return opts.output.columns;
}
else {
} else {
if (process.env.CLI_WIDTH) {
var width = parseInt(process.env.CLI_WIDTH, 10);
if (!isNaN(width)) {
if (!isNaN(width) && width !== 0) {
return width;

@@ -45,0 +45,0 @@ }

{
"name": "cli-width",
"version": "2.1.1",
"version": "2.2.0",
"description": "Get stdout window width, with two fallbacks, tty and then a default.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc