事件:'close'


🌐 Event: 'close'

当发生以下情况之一时,会触发 'close' 事件:

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

  • rl.close() 方法被调用,readline.Interface 实例已放弃对 inputoutput 流的控制;
  • input 流接收到它的 'end' 事件;
  • input 流接收 Ctrl+D 以表示传输结束 (EOT);
  • input 流接收到 Ctrl+C 来发送 SIGINT 信号,但在 readline.Interface 实例上没有注册 'SIGINT' 事件监听器。

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

🌐 The listener function is called without passing any arguments.

readline.Interface 实例在 'close' 事件被触发后就结束了。

🌐 The readline.Interface instance is finished once the 'close' event is emitted.