Is Node.js single-threaded?

Node.js basics · Freshers

Model answer

Your JavaScript code runs on one main thread, but Node is not limited to one thing at a time. Slow work such as file and network operations is handed to the operating system or to a libuv thread pool, and callbacks run when it finishes. For heavy CPU work you can use worker threads or separate processes.

Learn this topic

What Is Node.js? Install It and Run Your First Script in the course Node.js and Express: Build a Back End API from Scratch.

Sign in to add your own answer.

More questions