title: Node js child_process.execFile return
body: <p>I need to run a compiled file in C + + with node.js and bring me back a value from this file.
  I tried to use child_process.execFile, but I have no problems.
  This is the function I use:</p>
  
  <pre><code>var exec = require('child_process');
  Test.prototype.write = function (m) {
  var wRet;
  exec.execFile ('./mainCmd', ['-o', '\\!' + m + '.']
              function (error, stdout, stderr) {
                wRet = stdout;
                console.log ("wRet" + wRet);
                return wRet;
              });
  }
  </code></pre>
  
  <p>The problem is that the wRet in "console.log" contains text me back from the file c + +, in the "return" remains undefined.</p>
  
  <p>Can you help?</p>
  
  <p>Thank you all!</p>