
Lesson 01 · 10 min
The runtime and the event loop
One thread, a task queue, and no stopping to wait.
Node.js is the V8 engine from Chrome plus access to files, the network, and the process. There's no DOM or window. Your code runs on one thread, and slow operations (disk, network, database) are handed to the system while Node carries on with other work.
node app.jsruns a file.nodewith no arguments starts a REPL.process.envholds environment variables,process.argvthe command-line arguments.- Microtasks (Promises) run before timers.
Check
Lock it in before you move on
1. Is there a
documentin Node.js?2. A 3 s synchronous loop in a request handler…
3. What runs first:
setTimeout(..., 0)orPromise.then?