Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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()
}
```