title: node.js run function in child process?
body: <p>I have a node.js application that receives a file, via a web request and then will apply a conversion process to this file. Since the task is long running this needs to run separate to the main thread.</p>
  
  <p>At the moment I have just called the necessary code via a <code>setTimeout()</code> call. To isolate the main application from the conversion process I would like to move it out into a child process, since it is long running and I would like to isolate the main code from the work being done (am I worrying too much?). At the moment I am calling:</p>
  
  <pre><code>const execFile = require('child_process').execFile;
  const child = execFile('node', './myModule.js', (error, stdout, stderr) =&gt; {
    if (error) {
      throw error;
    }
    console.log(stdout);
  });
  </code></pre>
  
  <p>Is this the right approach in node.js, or is there of simply starting a child process with the module and params specified, but not have to specify 'node' as the executable?</p>