title: Meteor WrapAsync working asynchronously
body: <p>I am aware of <a href="https://stackoverflow.com/questions/26226583/meteor-proper-use-of-meteor-wrapasync-on-server">this</a> stackoverflow answer and I have been using it to help me.
  However something weird happens when I apply the code to my situation.
  It seems that the wrapAsync function, called execSync in my code, runs and outputs what it is supposed to; however, it just finished last as it did before i had the wrapAsync in place.</p>
  
  <p><strong>The code</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>Meteor.methods({
    'distinctSpecs'({}){
      console.log("called");
      var json_categories_clean   =   [];
      var execSync                =      
        Meteor.wrapAsync(require("child_process").exec, 
                         require("child_process"))
      var returned_data           =   
        execSync(
          "mongo products --eval \"var collection='laptops', outputFormat='json'\" variety.js", 
          { cwd:"/home/jonathan/Documents/variety-master"}, 
          (err, stdout, stderr) =&gt; {
            if (err) {
              console.error(err);
              console.log(stdout);
              console.log(stderr);
              return;
            }
            console.log("waited for this");
            var     json_categories         =   
              JSON.parse(stdout.substring(
                stdout.indexOf('[', stdout.indexOf('[')+1),
                stdout.lastIndexOf(']')+1));     
  
            for (var x=0; x &lt; json_categories.length; x++) {
              json_categories_clean.push(json_categories[x]["_id"])
            }
            console.log("returning inner");
            return json_categories_clean;
          });
      console.log("returning outer");
      return returned_data;
    }
  });
  </code></pre>
  
  <p>**The output  **</p>
  
  <pre><code> called 
  returning outer 
  waited for this 
  returning inner
  </code></pre>