事件:'resize'


🌐 Event: 'resize'

每当 writeStream.columnswriteStream.rows 属性发生变化时,都会触发 'resize' 事件。调用监听器回调时不会传递任何参数。

🌐 The 'resize' event is emitted whenever either of the writeStream.columns or writeStream.rows properties have changed. No arguments are passed to the listener callback when called.

process.stdout.on('resize', () => {
  console.log('screen size has changed!');
  console.log(`${process.stdout.columns}x${process.stdout.rows}`);
});