console-clear

Clear the console, cross-platform

MIT 3 个版本
安装
npm install console-clear
yarn add console-clear
pnpm add console-clear
bun add console-clear
README

console-clear

Clear the console, cross-platform

Install

$ npm install --save console-clear

Usage

const clear = require('console-clear');

clear(true);
//=> allow scrollback

clear();
//=> 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.

License

MIT © Luke Edwards

版本列表
1.1.1 2018-09-25
1.1.0 2018-01-21
1.0.0 2017-07-20