process: listen for the "exit" even on the main repl

pull/24503/head
Nathan Rajlich 2012-03-13 11:53:49 -07:00 committed by Bert Belder
parent f214758dd1
commit f9da776b33
1 changed files with 3 additions and 0 deletions

View File

@ -100,6 +100,9 @@
if (NativeModule.require('tty').isatty(0)) {
// REPL
var repl = Module.requireRepl().start('> ', null, null, true);
repl.on('exit', function() {
process.exit();
});
} else {
// Read all of stdin - execute it.