When a newcomer to Node.js first writes a file reading program, it comes out something like this.
But.. it does not work as intended. The program will never terminate. The while statement creates an infinite loop and halts everything. The file reading will never return its results. Nothing can proceed.
Trying to write the program like in the example is very understandable. In all of the popular web application languages and frameworks it would work. A Java or .NET programmer would expect here to be nothing wrong. In those environments a dedicated thread is allocated for program execution and other threads are easily created as needed to handle tasks elsewhere.
Code is run to completion
To allow other parts of the program to proceed, you have to deliberately give control back. You have to let others use the only available thread. You have to play together with the other parts of the program.
Need to return control back to the system
For the single-threaded model to work a program needs to return back control to "the system". In Node.js this system is called the event loop and similar concept is present in browsers as well.