cli-width
Advanced tools
Comparing version 2.0.0 to 2.1.0
13
index.js
@@ -33,7 +33,12 @@ 'use strict'; | ||
else { | ||
if (process.env.CLI_WIDTH) { | ||
var width = parseInt(process.env.CLI_WIDTH, 10); | ||
if (opts.output.columns) { | ||
return opts.output.columns; | ||
} | ||
else { | ||
if (process.env.CLI_WIDTH) { | ||
var width = parseInt(process.env.CLI_WIDTH, 10); | ||
if (!isNaN(width)) { | ||
return width; | ||
if (!isNaN(width)) { | ||
return width; | ||
} | ||
} | ||
@@ -40,0 +45,0 @@ } |
{ | ||
"name": "cli-width", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Get stdout window width, with two fallbacks, tty and then a default.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
cli-width | ||
========= | ||
Get stdout window width, with three fallbacks, `tty`, a custom environment variable and then a default. | ||
Get stdout window width, with four fallbacks, `tty`, `output.columns`, a custom environment variable and then a default. | ||
@@ -6,0 +6,0 @@ [![npm version](https://badge.fury.io/js/cli-width.svg)](http://badge.fury.io/js/cli-width) |
45213
427