I am at a point in my Node code where I need to retrieve 4 or 5 items from a database (MySQL), then do some math on the results and then return the result to the main part of the code which called the function. I can't really move on in the code until I have the data returned from these function or functions.
Everything I read says to NOT create synchronous functions because you take away all the joy and beauty of using Node. But, I literally can't move on with executing my code without the results from the functions.
So, don't I need a synchronous function here? If so, why does it feel so wrong? LOL.
I thought of doing one big outer function that is synchronous which contains the 4 or 5 functions that actually do the work. I can make the nested functions Async and make the outer function (the container) Synchronous.
Any thoughts on this? New to Node and just trying to do this right the first time.