aysnc functions don't return a value they return a Promise
so you can't get the value from them unless you await them this can be done in various ways the await keyword is the easiest and inside your async code you can always call a sync function
async useServerData()
{
result = await get_server_resource();
console.log(result);
processServerResource(result)
}
processServerResource(resource)
{
do Something
}
this has the advantage of not blocking your code
otherwise you can use the the then method to set a callback that you want to be called on completion
get_server_resource().then(processServerResource);
a really bad option would be to declare result outside the scope of your promise and then keep checking to see if it has been set
let result = null;
let main = async () => {
result = await get_server_resource();
console.log(result);
}
main();
while(result ===null)
{
}
processServerResource(result)
again this is not a recommended solution
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#Methods