src/index.js
function start() {
    proc = spawn(procCommand, procArgs, procOptions);

    var onClose = function (code) {
      if (!restarting) {
        process.exit(code);
      }
      start();
      restarting = false;
    };

    proc.on('error', function () {
      debug('restarting due error');
      restarting = true;
      proc.kill('SIGINT');
    });

    proc.on('close', onClose);
  }
function start() {
    proc = spawn(procCommand, procArgs, procOptions);

    var onClose = function (code) {
      if (!restarting) {
        process.exit(code);
      }
      start();
      restarting = false;
    };

    proc.on('error', function () {
      debug('restarting due error');
      restarting = true;
      proc.kill('SIGINT');
    });

    proc.on('close', onClose);
  }
function start ( ) { proc = spawn ( procCommand , procArgs , procOptions ) ; var onClose = function ( code ) { if ( ! restarting ) { process . exit ( code ) ; } start ( ) ; restarting = false ; } ; proc . on ( 'error' , function ( ) { debug ( 'restarting due error' ) ; restarting = true ; proc . kill ( 'SIGINT' ) ; } ) ; proc . on ( 'close' , onClose ) ; }
start the child process
start the child process