by crazygringo · 14y ago · 0 comments
It makes perfect sense in hindsight, even though at the time it could be easy to think, "how much could this really hurt?"
You really want to avoid synchronous calls all of the time in node.js unless you are at a point in the app's life where it makes sense to block if necessary, such as on startup or shutdown.
Since this call was used in logging my guess is that the synchronous write call was called a lot and was easy to spot because of it. There are other places where calls like that would be harder to track down. As with any programming environment it is important to understand how things are working at least one abstraction level below the code you are writing.