Node.js Architecture — 7/55 in the Node.js series. Full playlist companion: Node.js complete course on YouTube. Prefer one article? Read the complete Node.js tutorial.
Short description
Node.js architecture combines Google’s V8 engine with libuv. Your JavaScript runs on V8; async tasks (files, network) are offloaded and completed through the event loop.
Steps
- JS code executes in V8.
- Async work is handled via libuv/thread pool where needed.
- Callbacks/promises resume when the event loop picks them up.
Event loop demo
console.log('1 sync');
setTimeout(() => console.log('2 timeout'), 0);
Promise.resolve().then(() => console.log('3 promise'));
console.log('4 sync');