title: Can I await promise resolution (HTTP request) before exporting a variable in NodeJS module?
body: <p>I need to use an <strong>asynchronously computed value</strong> in a synchronous script which I cannot make async.</p>
  
  <p>If I write a module to make the HTTP request and calculate the value, when I require / import it will return a Promise: </p>
  
  <pre><code>// sync-script.js
  const getCurrencyConversion = require('./get-currency-conversion')
  getCurrencyConversion().then(result =&gt; console.log('Well too late now'))
  </code></pre>
  
  <p>Can I design my async module to await the HTTP response and return a value instead of a Promise? Should I?</p>
  
  <p>I'm looking to be able to: </p>
  
  <pre><code>// sync-script.js
  const getCurrencyConversion = require('./get-currency-conversion')
  const myComputedValue = getCurrencyConversion(42)
  // do sync stuff with it from here on out
  </code></pre>
  
  <p>Blocking wouldn't bother me in my little script, it makes sense to wait for the request before proceeding.</p>
  
  <p>But I would like to better understand how to deal with situations like these. My current understanding is once you go async you can never "go back". The sync script needs to support async or it won't work.</p>