Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukeed/console-clear
Clear the console, cross-platform
https://github.com/lukeed/console-clear
ansi clear console terminal
Last synced: 3 months ago
JSON representation
Clear the console, cross-platform
- Host: GitHub
- URL: https://github.com/lukeed/console-clear
- Owner: lukeed
- License: mit
- Created: 2017-07-20T22:45:11.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-03-16T08:08:25.000Z (almost 4 years ago)
- Last Synced: 2024-04-25T22:01:49.102Z (10 months ago)
- Topics: ansi, clear, console, terminal
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 21
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
- awesome-nodejs - console-clear - Clear the console, cross-platform. (Repository / Command-line Utilities)
README
# console-clear
> Clear the console, cross-platform
## Install
```
$ npm install --save console-clear
```## Usage
```js
const clear = require('console-clear');clear(true);
//=> allow scrollbackclear();
//=> no scrollback, if supported
```## API
### clear(keepHistory)
#### keepHistory
Type: `boolean`
Default: `false`Clears the console, but keeps the scrollback history intact.
> **For Windows:** This may be the *only* behavior available.
ANSI control sequences, like clearing the scrollback buffer, are [only handled in _recent_ versions of the native Windows console host](http://www.nivot.org/blog/post/2016/02/04/Windows-10-TH2-(v1511)-Console-Host-Enhancements).## License
MIT © [Luke Edwards](https://lukeed.com)