nodejs /

Node.js

Live map
Snapshotmain · 04a0c27

How Node boots a V8 environment, loads a main module, and carries TCP bytes through JavaScript, C++, and libuv.

Click a building or route
Choose a path

Follow the native process into V8 and trusted bootstrap code, then see how Node chooses and evaluates the application's module graph.

System map8 components · 9 connections
130%
Node.js architectureThe startup path crosses the upper row from the native process into JavaScript module loading. The lower runtime loop connects JavaScript APIs to native bindings, TCP handles, and libuv readiness callbacks.argc, argv, process fl…V8 context, process ob…entry filename or spec…module source, imports…JS bootstrapNative entryV8 environmentModule loadersJavaScriptAPIsNativebindingsTCPWraplibuvevent loop
Connections
BuildingsEntryServiceComputeStorageRuntimeToolingExternal

Terms, in plain English

V8 isolateAn independent V8 JavaScript heap and execution instance with its own garbage-collected state.

How to study this repo

  1. 1
    Separate boot layers

    Read node_main.cc, node.cc, and bootstrap/node.js in order and write down what becomes possible at each boundary.

  2. 2
    Load the same module two ways

    Compare the CJS and ESM loaders for resolution, caching, linking, and when user code is evaluated.

  3. 3
    Trace one TCP callback

    Start at net.Socket.connect, identify the TCPWrap request and uv_tcp_t operation, then follow the completion back to JavaScript.