title: Execute command line argument in Node.js with existing global variables?
body: <p>I'm executing something in the command line like so:</p>
  
  <pre><code>var exec = require('child_process').exec;
  var cmd = 'some command';
  
  exec(cmd, function(error, stdout, stderr) {
    console.log(error);
    console.log(stdout);
    console.log(stderr);
  });
  </code></pre>
  
  <p>It work's fine, but it doesn't seem to have the parents scope. For instance I have a <code>$app</code> global variable that is available in the calling function.</p>
  
  <p>But in the 'some command' I run it is not available. Is there any way to pass this in? Basically I wanna have access to <code>$app</code> in my child command line command.</p>