Skip to content

Commit

Permalink
Meta tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Dec 18, 2019
1 parent 07b96f0 commit 21c31e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
9 changes: 5 additions & 4 deletions package.json
Expand Up @@ -4,6 +4,7 @@
"description": "Reliably get the terminal window size (columns & rows)",
"license": "MIT",
"repository": "sindresorhus/term-size",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
Expand Down Expand Up @@ -34,9 +35,9 @@
"redirected"
],
"devDependencies": {
"ava": "^1.4.1",
"execa": "^1.0.0",
"tsd": "^0.7.3",
"xo": "^0.24.0"
"ava": "^2.4.0",
"execa": "^3.4.0",
"tsd": "^0.11.0",
"xo": "^0.25.3"
}
}
5 changes: 0 additions & 5 deletions readme.md
Expand Up @@ -6,14 +6,12 @@ Because [`process.stdout.columns`](https://nodejs.org/api/tty.html#tty_writestre

Confirmed working on macOS, Linux, and Windows.


## Install

```
$ npm install term-size
```


## Usage

```js
Expand All @@ -23,19 +21,16 @@ termSize();
//=> {columns: 143, rows: 24}
```


## API

### termSize()

Returns an `object` with `columns` and `rows` properties.


## Related

- [term-size-cli](https://github.com/sindresorhus/term-size-cli) - CLI for this module


---

<div align="center">
Expand Down
3 changes: 2 additions & 1 deletion test.js
Expand Up @@ -10,7 +10,8 @@ test('main', t => {
});

test('child', async t => {
const [columns, rows] = (await execa.stdout('node', ['fixture.js'])).split('\n').map(Number);
const {stdout} = await execa('node', ['fixture.js']);
const [columns, rows] = stdout.split('\n').map(Number);
console.log('Child size:', {columns, rows});
t.true(parseInt(columns, 10) > 0);
t.true(parseInt(rows, 10) > 0);
Expand Down

0 comments on commit 21c31e5

Please sign in to comment.