cli-width
Advanced tools
Comparing version 3.0.0 to 4.0.0
12
index.js
@@ -1,10 +0,10 @@ | ||
"use strict"; | ||
'use strict'; | ||
exports = module.exports = cliWidth; | ||
module.exports = cliWidth; | ||
function normalizeOpts(options) { | ||
let defaultOpts = { | ||
const defaultOpts = { | ||
defaultWidth: 0, | ||
output: process.stdout, | ||
tty: require("tty"), | ||
tty: require('tty'), | ||
}; | ||
@@ -26,3 +26,3 @@ | ||
function cliWidth(options) { | ||
let opts = normalizeOpts(options); | ||
const opts = normalizeOpts(options); | ||
@@ -42,3 +42,3 @@ if (opts.output.getWindowSize) { | ||
if (process.env.CLI_WIDTH) { | ||
let width = parseInt(process.env.CLI_WIDTH, 10); | ||
const width = parseInt(process.env.CLI_WIDTH, 10); | ||
@@ -45,0 +45,0 @@ if (!isNaN(width) && width !== 0) { |
{ | ||
"name": "cli-width", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"description": "Get stdout window width, with two fallbacks, tty and then a default.", | ||
@@ -23,11 +23,15 @@ "main": "index.js", | ||
"engines": { | ||
"node": ">= 10" | ||
"node": ">= 12" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "^3.0.11", | ||
"nyc": "^15.0.1", | ||
"standard-version": "^7.1.0", | ||
"coveralls": "^3.1.1", | ||
"nyc": "^15.1.0", | ||
"standard-version": "^9.3.2", | ||
"tap-spec": "^5.0.0", | ||
"tape": "^4.13.2" | ||
"tape": "^5.5.2" | ||
}, | ||
"volta": { | ||
"node": "12.22.11", | ||
"npm": "8.5.5" | ||
} | ||
} |
@@ -18,6 +18,4 @@ # cli-width | ||
```js | ||
"use strict"; | ||
const cliWidth = require('cli-width'); | ||
const cliWidth = require("cli-width"); | ||
cliWidth(); // maybe 204 :) | ||
@@ -46,4 +44,4 @@ ``` | ||
```js | ||
const cliWidth = require("cli-width"); | ||
const ttys = require("ttys"); | ||
const cliWidth = require('cli-width'); | ||
const ttys = require('ttys'); | ||
@@ -59,4 +57,4 @@ cliWidth({ | ||
```js | ||
const cliWidth = require("cli-width"); | ||
const ttys = require("ttys"); | ||
const cliWidth = require('cli-width'); | ||
const ttys = require('ttys'); | ||
@@ -63,0 +61,0 @@ cliWidth({ |
Sorry, the diff of this file is not supported yet
5378
7
71