1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.errtermwidth = exports.stdtermwidth = void 0;
|
4 | function termwidth(stream) {
|
5 | if (!stream.isTTY) {
|
6 | return 80;
|
7 | }
|
8 | const width = stream.getWindowSize()[0];
|
9 | if (width < 1) {
|
10 | return 80;
|
11 | }
|
12 | if (width < 40) {
|
13 | return 40;
|
14 | }
|
15 | return width;
|
16 | }
|
17 | const columns = global.columns;
|
18 | exports.stdtermwidth = columns || termwidth(process.stdout);
|
19 | exports.errtermwidth = columns || termwidth(process.stderr);
|