title: nodemon : Passing arguments to the executable when using as a required module
body: <p>I'm trying to start a script with nodemon, using it as a required module, and I cannot pass arguments correctly.</p>
  
  <p>For example, for </p>
  
  <pre><code>var args = [ 
    process.argv[0], '--harmony', 
    '/path/to/script.js', '-i', 'logs'
  ];`
  </code></pre>
  
  <p>I'm expecting the script to be launched as : </p>
  
  <pre><code>node --harmony /path/to/script.js -i logs
  </code></pre>
  
  <p>But it doesn't work and all I can manage to get is </p>
  
  <pre><code>node --harmony /path/to/script.js -i logs /path/to/script.js
  </code></pre>
  
  <p>This is what I tried :</p>
  
  <pre><code>var app = require('nodemon')({
      script: args[2],
      exec: args.join(' ')
  });
  </code></pre>
  
  <p>I know about <code>execMap</code>, but it's no good as I cannot pass arguments at the end anyway.</p>
  
  <p>How can it be done?</p>