Well, let it break a little. Single-threaded applications have advantages: you can never get deadlocks or race conditions. These problems are associated with simultaneous memory access in multi-threaded systems. If two threads access the same piece of information, strange things can happen.
So why does JavaScript have Workers? If you need some kind of heavy processing, you are going to block the event loop, you can try to split the workload by creating timer events, but this is tedious. A worker allows you to create a thread under one condition: without access to shared memory . This solves the problem of intensive processing in a single-threaded environment, while avoiding the traps of multi-threaded environments (dead ends, race conditions).
And as @dandavis said, if you have a multi-core processor (which everyone does these days), worker threads can be offloaded to other cores.
You should appreciate this, although JavaScript is single-threaded, the environment is still very multi-threaded. Reading the file is not blocked in Node.JS, but there is probably a thread to support it in the OS.
As a minor addition, I would say that the greatest advantage of Node.JS is that it allows you to write JavaScript on the server, which allows you to share code between the client and server. The fact that it is non-blocking is good, but threads are already solving this. Non-blocking IO stems from a single threaded. It is very inconvenient to have one thread with an IO lock.
Halcyon Jan 31 '14 at 17:11 2014-01-31 17:11
source share