'pause' 事件


当发生以下任一情况时会触发 'pause' 事件:

  • input 流被暂停。
  • input 流未暂停,且接收到 'SIGCONT' 事件。(参阅 'SIGTSTP' 事件和 'SIGCONT' 事件)

调用监听器函数时不传入任何参数。

rl.on('pause', () => {
  console.log('Readline 暂停');
});

The 'pause' event is emitted when one of the following occur:

  • The input stream is paused.
  • The input stream is not paused and receives the 'SIGCONT' event. (See events 'SIGTSTP' and 'SIGCONT'.)

The listener function is called without passing any arguments.

rl.on('pause', () => {
  console.log('Readline paused.');
});