Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timneutkens/brighten
Clear terminal screen but keep output history
https://github.com/timneutkens/brighten
Last synced: 21 days ago
JSON representation
Clear terminal screen but keep output history
- Host: GitHub
- URL: https://github.com/timneutkens/brighten
- Owner: timneutkens
- Created: 2017-08-15T22:56:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-15T23:10:27.000Z (over 7 years ago)
- Last Synced: 2024-04-25T19:21:21.142Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 89.8 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Brighten
Clear terminal screen but keep output history.
### History
While working on [friendly-errors-webpack-plugin](https://github.com/geowarin/friendly-errors-webpack-plugin) to improve it for [Next.js](https://github.com/zeit/next.js), I needed to clear the terminal screen without overriding previous output. Using ANSI escapes works for clearing the screen, but it will also override the output that's visible at that moment. So I created this simple solution to clear the screen but keep the history
## Installation
```
npm install --save brighten
```## Usage
```js
const brighten = require('brighten')// clear screen when process is a TTY
if(process.stdout.isTTY) {
brighten()
}
```