title: Restart a node.js app from code level
body: <p>I've an app which initially creates <code>static</code> config files (once) and after files were written I need to reinitialize/restart the application.
  Is there something to restart a <strong>node.js</strong> app from itself?</p>
  
  <p>This is required cause I've an application running in two <code>runlevels</code> in <strong>node.js</strong>.
  The initial one starts completly <code>synchronus</code> and after this level has been completed app is in async runlevel in a previously started environment.</p>
  
  <p>I know there are tools like nodemon but that's not what I need in my case.</p>
  
  <p>I tried to kill the app via <code>process.kill()</code> which is working but I can't listen to the kill event:</p>
  
  <pre><code> // Add the listener
   process.on('exit', function(code) {
      console.log('About to exit with code:', code);
      // Start app again but how?
   });
  
   // Kill application
   process.kill();
  </code></pre>
  
  <p>Or is there a better, cleaner way to handle this?</p>