'close' 事件


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

  • rl.close() 方法被调用,readline.Interface 实例放弃了对 inputoutput 流的控制;
  • input 流接收到它的 'end' 事件;

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

一旦触发 'close' 事件,则 readline.Interface 实例就完成了。

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

  • The rl.close() method is called and the readline.Interface instance has relinquished control over the input and output streams;
  • The input stream receives its 'end' event;
  • The input stream receives <ctrl>-D to signal end-of-transmission (EOT);
  • The input stream receives <ctrl>-C to signal SIGINT and there is no 'SIGINT' event listener registered on the readline.Interface instance.

The listener function is called without passing any arguments.

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