48

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?

mikemaccana
  • 110,530
  • 99
  • 389
  • 494

1 Answers1

98

Nevermind, it's close.

reader.on('close', cb);
mikemaccana
  • 110,530
  • 99
  • 389
  • 494