UNPKG

437 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6function termwidth(stream) {
7 if (!stream.isTTY) return 80;
8 const width = stream.getWindowSize()[0];
9 if (width < 1) return 80;
10 if (width < 40) return 40;
11 return width;
12}
13
14const stdtermwidth = exports.stdtermwidth = global.columns || termwidth(process.stdout);
15const errtermwidth = exports.errtermwidth = global.columns || termwidth(process.stderr);
\No newline at end of file