mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
14 lines
362 B
JavaScript
14 lines
362 B
JavaScript
import readline from 'readline';
|
|
|
|
export const clearConsole = (title) => {
|
|
if (process.stdout.isTTY) {
|
|
const blank = '\n'.repeat(process.stdout.rows);
|
|
console.log(blank);
|
|
readline.cursorTo(process.stdout, 0, 0);
|
|
readline.clearScreenDown(process.stdout);
|
|
if (title) {
|
|
console.log(title);
|
|
}
|
|
}
|
|
};
|