cli-width
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -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", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
5268
0
41