title: How to fork a process in Node.js to run JS code from a buffer available in parent rather than from a file?
body: <p>I am using </p>
  
  <pre><code> child_process.fork(scriptFile) 
  </code></pre>
  
  <p>to fork a child process and to execute the JS in scriptFile. The problem is that I want to optimize it because the JS code I want to run is already available in a buffer in the parent. I am now writing it to a file and then specifying that path to child_process.fork. This involves two redundant I/O. First I write the JS to a file in the parent. It is then read by the child process.</p>
  
  <p>Any way to prevent this?  </p>