Node 'readline' module does not have an 'end' event - how can I do something when there are no more lines?

StackOverflow https://stackoverflow.com/questions/22915794

  •  29-06-2023
  •  | 
  •  

Pregunta

Reading the official docs for the readline module, there is no end event like other streams. Trying

reader.on('end', cb);

Doesn't work.

How can I run a callback once there are no more lines to be read?

¿Fue útil?

Solución

Nevermind, it's close.

reader.on('close', cb);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top