Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Node.js If v8 Runs Your JavaScript, What Runs The Node.js Api?

I'm trying to understand the internal structure of Node.js. To my understanding V8 runs the JavaScript(EcmaScript) which makes sense. Since all the Node.js Api is not JavaScript but looks like JavaScript, My question is, what runs the Node.js Api. For example what runs

http.createServer();

Or

fs.readFile();
like image 843
claOnline Avatar asked May 25 '26 13:05

claOnline


1 Answers

All of Node.js API is JavaScript.

Only the I/O operations are delegated to the libuv library which is written entirely in C. Stuff like fs.readFile is just wrappers around libuv functions, the so called POSIX API.

like image 71
Mayank Sinha Avatar answered May 27 '26 04:05

Mayank Sinha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!