Post

Anuj nema
Anuj nema@letscodeanuj·
🧵Why Node.js is called "asynchronous I/O" or "non-blocking I/O"?
English
1
0
0
14
Anuj nema
Anuj nema@letscodeanuj·
Node.js sits on top of V8 Engine and libuv. V8 can only execute javascript synchronously - line by line. But here's the magic: when async operations happen, Node offloads them to libuv. It is not managed by V8 Engine nor by core node implementation.
English
1
0
0
9
Anuj nema
Anuj nema@letscodeanuj·
Libuv is written in C (97% C code!) and it's THE library that makes Node.js asynchronous. Basically it is a bridge between JavaScript and OS-level operations.
English
1
0
0
4
Anuj nema
Anuj nema@letscodeanuj·
Node.js has this whole other world: File I/O, Database connections, Timers, Network requests, fs, crypto, zlib - This is all managed by the OS through libuv.
English
1
0
0
10
Anuj nema
Anuj nema@letscodeanuj·
When your JS code hits async operations (file reads, DB queries, timers), Node doesn't block. It delegates to libuv, and when libuv finishes, it pushes from callback queue back to the call stack.
English
1
0
0
20
Anuj nema
Anuj nema@letscodeanuj·
This is why we say Node.js is "asynchronous I/O" or "non-blocking I/O". It's not blocking your main single thread - it gets offloaded to libuv, and async operations don't hold up your code execution. #nodejs #javascript #expressjs
English
0
0
0
17
Paylaş