cli-width
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -8,3 +8,3 @@ 'use strict'; | ||
if (process.stdout.getWindowSize) { | ||
return process.stdout.getWindowSize()[0]; | ||
return process.stdout.getWindowSize()[0] || exports.defaultWidth; | ||
} | ||
@@ -15,3 +15,3 @@ else { | ||
if (tty.getWindowSize) { | ||
return tty.getWindowSize()[1]; | ||
return tty.getWindowSize()[1] || exports.defaultWidth; | ||
} | ||
@@ -18,0 +18,0 @@ else { |
{ | ||
"name": "cli-width", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Get stdout window width, with two fallbacks, tty and then a default.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "node test | tap-spec" | ||
"test": "node test | tspec", | ||
"coverage": "isparta cover test/*.js | tspec", | ||
"coveralls": "npm run coverage -s && coveralls < coverage/lcov.info", | ||
"postcoveralls": "rimraf ./coverage" | ||
}, | ||
@@ -20,5 +23,8 @@ "repository": { | ||
"devDependencies": { | ||
"tap-spec": "^2.2.0", | ||
"tape": "^3.4.0" | ||
"tap-spec": "^4.1.0", | ||
"tape": "^3.4.0", | ||
"coveralls": "^2.11.4", | ||
"isparta": "^3.0.4", | ||
"rimraf": "^2.4.3" | ||
} | ||
} |
@@ -6,2 +6,6 @@ cli-width | ||
[![npm version](https://badge.fury.io/js/cli-width.svg)](http://badge.fury.io/js/cli-width) | ||
[![Build Status](https://travis-ci.org/knownasilya/cli-width.svg)](https://travis-ci.org/knownasilya/cli-width) | ||
[![Coverage Status](https://coveralls.io/repos/knownasilya/cli-width/badge.svg?branch=master&service=github)](https://coveralls.io/github/knownasilya/cli-width?branch=master) | ||
## Usage | ||
@@ -23,4 +27,4 @@ | ||
If none of the methods are supported, the default is `0` and | ||
can be changed via `cliWidth.defaultWidth = 200;`. | ||
If none of the methods are supported, and the environment variable isn't set, | ||
the default is `0` and can be changed via `cliWidth.defaultWidth = 200;`. | ||
@@ -33,1 +37,3 @@ ## Tests | ||
``` | ||
Coverage can be generated with `npm run coverage`. |
Sorry, the diff of this file is not supported yet
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
43904
16
406
37
2
5
1