node command clear code example Example 1: clear terminal node js process.stdout.write('\x1Bc'); Example 2: clear the command prompt node console.log('\033[2J');