title: How to retrieve data from "promise"
body: <pre><code>import &quot;@babel/polyfill&quot;;
  
  export async function resolveRemotePost(url){
          const fetch = require('node-fetch');
  
          return await fetch(url).then((data) =&gt; data.json());
  }
  
  export function getRemoteContent(url){
          let webpage = resolveRemotePost(url);
          console.log(&quot;Remote content&quot;)
          console.log(webpage);
  </code></pre>
  <p>The following code tries to call a url and assign the json data to the variable webpage. However what it does instead is return a &quot;promise&quot;. (I'm new to javascript). I understand how asynchronous functions work (i think) but in javascript I cannot seem to figure out how to exactly get the data I'm trying to fetch. My question is how do I unwrap this promise to retrieve the data contained within it?</p>