Nodejs compilation flow

Solution 1:

Node uses libuv for most of that. See:

  • https://github.com/libuv/libuv

It exposes the functionality provided by libuv to V8. See:

  • https://github.com/v8/v8

See this tutorial to see how such bindings look like:

  • http://luismreis.github.io/node-bindings-guide/

You can think of Node as V8 binding of libuv. When you read the documentation of libuv and for V8, you will get some feel of how they both can be combined together - and their combination is basically the answer to your questions.

Take a look at the Node source code:

  • https://github.com/nodejs/node

Just looking around a repo can give you a good feel of how it all works.