How to wrap async function calls into a sync function in Node.js or Javascript? How to wrap async function calls into a sync function in Node.js or Javascript? javascript javascript