robin*

Implement exit feature

Showing 1 changed file with 3 additions and 0 deletions
...@@ -6,6 +6,9 @@ const rl = readline.createInterface({ ...@@ -6,6 +6,9 @@ const rl = readline.createInterface({
6 }); 6 });
7 rl.prompt(); 7 rl.prompt();
8 rl.on('line', (l) => { 8 rl.on('line', (l) => {
9 + if(l.trim().toLowerCase() === 'exit') {
10 + process.exit();
11 + }
9 console.log(l); 12 console.log(l);
10 rl.prompt(); 13 rl.prompt();
11 }); 14 });
......