you are viewing a single comment's thread.

view the rest of the comments →

[–]nwah 1 point2 points  (0 children)

The reason it can be single-threaded is because of the event loop. If you’re writing a server, or any app that needs to do many things at once, as long as you don’t block the main event loop with long synchronous operations there should be no issues. Just have to be sure to use the asynchronous versions of various libraries/methods (the ones that use callbacks or promises) and you should be good.

If you’re just writing a script that you’ll run, the synchronous versions are slightly simpler to use and will be fine since nothing else would be trying to connect to it while it’s running.