Is there any way to know if a function is asynchronous or synchronous in node.js ? Thanks in advance.
There's no programmatic way to tell.
The reliable way is to read the documentation.
You can also try to infer it from the function accepting a callback (but that isn't reliable, see Array.prototype.forEach for an example of a synchronous function that accepts a callback).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With