title: Wrap native (c++) method inside a Promise
body: <p>I have a synchronous C++ Node.js addon function that does an heavy operation:</p>
  <pre><code>Napi::Object SyncHeavyFunction(const Napi::CallbackInfo&amp; info) {
      std::this_thread::sleep_for(std::chrono::seconds(50));
      ...
      return env.Null();
  }
  </code></pre>
  <p>I'm trying to run it asynchronously wrapping it into a javascript Promise:</p>
  <pre><code>console.log(&quot;before creating the Promise&quot;);
  let p = new Promise((resolve) =&gt; {
       const out = SyncHeavyFunction();
       reolve(out)
  });
  console.log(&quot;after creating the Promise&quot;);
  </code></pre>
  <p>However it seems that the creation of the Promise blocks until the underlying native function terminates.
  I'm wondering if this behavior is expected and which is the best way to achieve the asynchronous call of a synchronous native function only using javascript code.</p>