Node.js, Express & HTTP
Trace requests, understand the runtime, and build reliable APIs.
How can Node handle many requests with one JavaScript thread?
Node.js is a JavaScript runtime designed to handle many operations that spend time waiting for I/O. It lets the operating system and supporting runtime facilities wait for work, then runs ready JavaScript callbacks on an event-loop thread. This makes one process useful for many concurrent connections without one JavaScript thread per request.
What do V8, libuv and the thread pool do?
V8 is the engine that executes JavaScript, while libuv provides the event loop and cross-platform I/O support. The libuv thread pool runs certain operations that would otherwise block, such as many file-system calls. These are separate roles: V8 does not itself manage every network request, and not every async call uses a pool thread.
What are the main event-loop phases?
The event loop is the scheduling mechanism that decides when ready callbacks can run. Node organizes several categories of callbacks into phases, with separate processing for promise microtasks and next-tick callbacks. A timer delay is a minimum waiting threshold, not a promise of an exact execution time.
Worker thread vs process: when would I use each?
A process is an independently running program with its own address space and operating-system resources. A worker thread is another execution thread inside a process; Node workers have separate JavaScript execution environments and can exchange messages or share selected memory. Workers help CPU parallelism, while processes also provide stronger failure isolation.
Difficulty is an editorial estimate. Completion means you chose to mark a question as understood.