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
  •  | 
  •  

Pergunta

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?

Foi útil?

Solução

Nevermind, it's close.

reader.on('close', cb);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top