# nodejs/node architecture

> Architecture diagram of the GitHub repository nodejs/node, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nodejs/node
- Repository: https://github.com/nodejs/node

## Overview

Node.js is a cross-platform JavaScript runtime. The principal workflow is that an application supplies JavaScript to the runtime, V8 executes and compiles it, and Node.js exposes platform services such as networking, streams, storage, cryptography, and WebAssembly. The graph preserves those major runtime branches and shows the sampled Web Storage/Inspector relationship. Most runtime subsystems are represented at directory or central-module level; unsampled internal connections are omitted rather than inferred.

Main entry points: [`src/node.h`](https://github.com/nodejs/node/blob/main/src/node.h) (Node core), [`src/node_webstorage.cc`](https://github.com/nodejs/node/blob/main/src/node_webstorage.cc) (Web Storage), [`deps/v8/include/v8.h`](https://github.com/nodejs/node/blob/main/deps/v8/include/v8.h) (V8 engine), [`deps/v8/src/compiler/pipeline.cc`](https://github.com/nodejs/node/blob/main/deps/v8/src/compiler/pipeline.cc) (Optimizing compiler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime Core"]
  node_nodecore["Node core<br/>[node.h]"]
  node_environment["Runtime environment<br/>[env.h]"]
end

subgraph group_engine["V8 Engine"]
  node_v8["V8 engine<br/>[v8.h]"]
  node_v8globals["V8 runtime types<br/>[globals.h]"]
  node_compiler["Optimizing compiler<br/>[pipeline.cc]"]
  node_turboshaft["Turboshaft pipeline<br/>[pipelines.h]"]
  node_wasm["WebAssembly engine<br/>[wasm-engine.cc]"]
end

subgraph group_apis["Platform APIs"]
  node_http["HTTP client<br/>[_http_client.js]"]
  node_streams["Stream pipelines<br/>[pipeline.js]"]
  node_webstorage["Web Storage<br/>[node_webstorage.cc]"]
  node_webstoragejs["Web Storage API<br/>[webstorage.js]"]
  node_inspector["Inspector storage"]
end

subgraph group_services["Runtime Services"]
  node_sqlite[("SQLite backing store<br/>[sqlite3.h]")]
  node_crypto["Cryptography<br/>[engine.h]"]
  node_quic["QUIC engine<br/>[quic_engine.c]"]
end

node_app(("JavaScript app"))

node_app -->|"runs through"| node_nodecore
node_nodecore -.->|"executes JavaScript"| node_v8
node_compiler -->|"compiles code"| node_v8
node_turboshaft -.->|"provides pipeline"| node_compiler
node_wasm -->|"manages WebAssembly"| node_v8
node_nodecore -.->|"uses runtime state"| node_environment
node_http -.->|"uses streams"| node_streams
node_webstoragejs -.->|"exposes storage"| node_webstorage
node_webstorage -->|"reads and writes"| node_sqlite
node_inspector -->|"accesses storage"| node_webstorage

click node_nodecore "https://github.com/nodejs/node/blob/main/src/node.h"
click node_environment "https://github.com/nodejs/node/blob/main/src/env.h"
click node_v8 "https://github.com/nodejs/node/blob/main/deps/v8/include/v8.h"
click node_v8globals "https://github.com/nodejs/node/blob/main/deps/v8/src/common/globals.h"
click node_compiler "https://github.com/nodejs/node/blob/main/deps/v8/src/compiler/pipeline.cc"
click node_turboshaft "https://github.com/nodejs/node/blob/main/deps/v8/src/compiler/turboshaft/pipelines.h"
click node_wasm "https://github.com/nodejs/node/blob/main/deps/v8/src/wasm/wasm-engine.cc"
click node_http "https://github.com/nodejs/node/blob/main/lib/_http_client.js"
click node_streams "https://github.com/nodejs/node/blob/main/lib/internal/streams/pipeline.js"
click node_webstorage "https://github.com/nodejs/node/blob/main/src/node_webstorage.cc"
click node_webstoragejs "https://github.com/nodejs/node/blob/main/lib/internal/webstorage.js"
click node_inspector "https://github.com/nodejs/node/blob/main/src/inspector/dom_storage_agent.cc"
click node_sqlite "https://github.com/nodejs/node/blob/main/deps/sqlite/sqlite3.h"
click node_crypto "https://github.com/nodejs/node/blob/main/deps/openssl/openssl/include/openssl/engine.h"
click node_quic "https://github.com/nodejs/node/blob/main/deps/openssl/openssl/ssl/quic/quic_engine.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_nodecore,node_environment toneBlue
class node_v8,node_v8globals,node_compiler,node_turboshaft,node_wasm toneAmber
class node_http,node_streams,node_webstorage,node_webstoragejs,node_inspector toneMint
class node_sqlite,node_crypto,node_quic toneRose
class node_app toneIndigo
```

## Components

### Runtime Core

- [Node core](https://github.com/nodejs/node/blob/main/src/node.h): `src/node.h`
- [Runtime environment](https://github.com/nodejs/node/blob/main/src/env.h): `src/env.h`

### V8 Engine

- [V8 engine](https://github.com/nodejs/node/blob/main/deps/v8/include/v8.h): `deps/v8/include/v8.h`
- [V8 runtime types](https://github.com/nodejs/node/blob/main/deps/v8/src/common/globals.h): `deps/v8/src/common/globals.h`
- [Optimizing compiler](https://github.com/nodejs/node/blob/main/deps/v8/src/compiler/pipeline.cc): `deps/v8/src/compiler/pipeline.cc`
- [Turboshaft pipeline](https://github.com/nodejs/node/blob/main/deps/v8/src/compiler/turboshaft/pipelines.h): `deps/v8/src/compiler/turboshaft/pipelines.h`
- [WebAssembly engine](https://github.com/nodejs/node/blob/main/deps/v8/src/wasm/wasm-engine.cc): `deps/v8/src/wasm/wasm-engine.cc`

### Platform APIs

- [HTTP client](https://github.com/nodejs/node/blob/main/lib/_http_client.js): `lib/_http_client.js`
- [Stream pipelines](https://github.com/nodejs/node/blob/main/lib/internal/streams/pipeline.js): `lib/internal/streams/pipeline.js`
- [Web Storage](https://github.com/nodejs/node/blob/main/src/node_webstorage.cc): `src/node_webstorage.cc`
- [Web Storage API](https://github.com/nodejs/node/blob/main/lib/internal/webstorage.js): `lib/internal/webstorage.js`
- [Inspector storage](https://github.com/nodejs/node/blob/main/src/inspector/dom_storage_agent.cc): `src/inspector/dom_storage_agent.cc`

### Runtime Services

- [SQLite backing store](https://github.com/nodejs/node/blob/main/deps/sqlite/sqlite3.h): `deps/sqlite/sqlite3.h`
- [Cryptography](https://github.com/nodejs/node/blob/main/deps/openssl/openssl/include/openssl/engine.h): `deps/openssl/openssl/include/openssl/engine.h`
- [QUIC engine](https://github.com/nodejs/node/blob/main/deps/openssl/openssl/ssl/quic/quic_engine.c): `deps/openssl/openssl/ssl/quic/quic_engine.c`

### Other components

- **JavaScript app**

## Connections

- JavaScript app → Node core: runs through (evidence: `README.md`)
- Node core → V8 engine: executes JavaScript
- Optimizing compiler → V8 engine: compiles code (evidence: `deps/v8/src/compiler/pipeline.cc`)
- Turboshaft pipeline → Optimizing compiler: provides pipeline
- WebAssembly engine → V8 engine: manages WebAssembly (evidence: `deps/v8/src/wasm/wasm-engine.cc`)
- Node core → Runtime environment: uses runtime state
- HTTP client → Stream pipelines: uses streams
- Web Storage API → Web Storage: exposes storage
- Web Storage → SQLite backing store: reads and writes (evidence: `src/node_webstorage.cc`)
- Inspector storage → Web Storage: accesses storage (evidence: `src/inspector/dom_storage_agent.cc`)
