line event (Readline)

Event: 'line'

function (line) {}

Emitted whenever the input stream receives an end of line (\n, \r, or \r\n), usually received when the user hits enter, or return. This is a good hook to listen for user input.

Example of listening for 'line':

rl.on('line', (cmd) => {
  console.log(`You just typed: ${cmd}`);
});
doc_Nodejs
2016-04-30 04:40:17
Comments
Leave a Comment

Please login to continue.