.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / term-size / readme.md
1 # term-size [![Build Status: Linux & macOS](https://travis-ci.org/sindresorhus/term-size.svg?branch=master)](https://travis-ci.org/sindresorhus/term-size) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/c3tydg6uedsk0bob/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/term-size/branch/master)
2
3 > Reliably get the terminal window size
4
5 Because [`process.stdout.columns`](https://nodejs.org/api/tty.html#tty_writestream_columns) doesn't exist when run [non-interactively](http://www.tldp.org/LDP/abs/html/intandnonint.html), for example, in a child process or when piped. This module even works when all the TTY file descriptors are redirected!
6
7 Confirmed working on macOS, Linux, and Windows.
8
9
10 ## Install
11
12 ```
13 $ npm install --save term-size
14 ```
15
16
17 ## Usage
18
19 ```js
20 const termSize = require('term-size');
21
22 termSize();
23 //=> {columns: 143, rows: 24}
24 ```
25
26
27 ## API
28
29 ### termSize()
30
31 Returns an `Object` with `columns` and `rows` properties.
32
33
34 ## Related
35
36 - [term-size-cli](https://github.com/sindresorhus/term-size-cli) - CLI for this module
37
38
39 ## License
40
41 MIT © [Sindre Sorhus](https://sindresorhus.com)