title: Node.js async to sync
body: <p>How can I make this work</p>
  
  <pre><code>var asyncToSync = syncFunc();
  
  function syncFunc() {
      var sync = true;
      var data = null;
      query(params, function(result){
          data = result;
          sync = false;
      });
      while(sync) {}
      return data;
  }
  </code></pre>
  
  <p>I tried to get sync function from async one, 
  I need it to use FreeTds async query as sync one</p>