lib/index.js
function(err, exit) {
    // Close the terminal
    if(terminal) terminal.close()

    // If there was an error throw it before exit
    if(err) throw err

    // process.stdin.resume() prevents node from exiting.
    // process.exit() overrides in more cases than stdin.pause() or stdin.end()
    // it also means we don't need to call process.stdin.setRawMode(false)
    if(exit === undefined || exit) {
      process.exit()
    }
    else {
      process.stdin.setRawMode(false)
      process.stdin.end()
    }
  }
function(err, exit) {
    // Close the terminal
    if(terminal) terminal.close()

    // If there was an error throw it before exit
    if(err) throw err

    // process.stdin.resume() prevents node from exiting.
    // process.exit() overrides in more cases than stdin.pause() or stdin.end()
    // it also means we don't need to call process.stdin.setRawMode(false)
    if(exit === undefined || exit) {
      process.exit()
    }
    else {
      process.stdin.setRawMode(false)
      process.stdin.end()
    }
  }
function ( err , exit ) { // Close the terminal if ( terminal ) terminal . close ( ) // If there was an error throw it before exit if ( err ) throw err // process.stdin.resume() prevents node from exiting. // process.exit() overrides in more cases than stdin.pause() or stdin.end() // it also means we don't need to call process.stdin.setRawMode(false) if ( exit === undefined || exit ) { process . exit ( ) } else { process . stdin . setRawMode ( false ) process . stdin . end ( ) } }
Close terminal and exit process

@method end
@param {Object} err Error
@param {Boolean} exit Exit process?
Close terminal and exit process