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

Domanda

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?

È stato utile?

Soluzione

Nevermind, it's close.

reader.on('close', cb);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top