3

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();

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

So you mean v8 runs fs.readFile() , http.createServer() e.t.c
@claOnline absolutely

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.