nodejs/node
Fun facts
A pile of things you only learn after spending a while in git log.
The first commit pre-dates node itself
Ryan Dahl's first commit on 2009‑02‑16 has the subject add dependencies. The repo was a directory of dependencies before there was any "node" code at all.
The biggest source file in the tree is fs
src/node_file.cc is 141 KB, edging out src/node_sqlite.cc (130 KB), src/js_native_api_v8.cc (128 KB), and src/node_http2.cc (128 KB). The reason is the long tail of POSIX FS APIs Node has to implement consistently across operating systems with very different semantics (Windows reparse points, macOS APFS clones, Linux extended attributes, …).
lib/internal/util/inspect.js is bigger than every public module
At ~98 KB, the util.inspect implementation is larger than lib/fs.js (85 KB), lib/net.js (70 KB), and most public modules. Pretty-printing arbitrary user objects with cycles, getters, proxies, typed arrays, and ANSI colors apparently takes a lot of code.
LTS code names form a periodic-table sequence
The LTS code names are alphabetically ordered after a chemistry theme: Argon (v4), Boron (v6), Carbon (v8), Dubnium (v10), Erbium (v12), Fermium (v14), Gallium (v16), Hydrogen (v18), Iron (v20), Jod (v22), …. The sequence skips elements that don't fit cleanly into "month abbreviation also pronounceable" (Aluminium, Beryllium, …), but the alphabet is strict.
You can replace Array.prototype.map and Node will not break
Internal modules pull frozen primordials from lib/internal/per_context/primordials.js so user-land prototype pollution cannot reach them. The cost of this hardening is real (each access is a function call), but it has prevented a long list of accidental and intentional breakages over the years.
node has a snapshot of itself baked into it
When you launch node, the V8 isolate it builds is deserialized from a snapshot generated at build time, not freshly bootstrapped. The result: lib/internal/bootstrap/realm.js and lib/internal/bootstrap/node.js essentially run "once forever" during the build, and every subsequent node invocation just rehydrates the heap. Pass --no-node-snapshot to take the slow path.
The man page is generated, not hand-written
doc/node.1 is regenerated from doc/api/cli.md by the doctool in tools/doc/. Adding a CLI flag updates the man page automatically.
lib/_http_*.js filenames have leading underscores for historical reasons
Files prefixed with _ were the convention in Node's early years for "look, do not import this directly". The HTTP module survives in that form (_http_agent.js, _http_client.js, _http_common.js, _http_incoming.js, _http_outgoing.js, _http_server.js) even though modern code under lib/internal/ uses a different naming scheme.
TLS sockets are streams over streams over streams
A tls.TLSSocket is a Duplex over a TLSWrap (which is itself a StreamBase) over a parent Socket (also a StreamBase). The parent socket can be a net.Socket over a TCPWrap over uv_tcp_t over the kernel TCP stack. Every layer is a StreamBase so they can splice efficiently in C++ via src/stream_pipe.cc.
QUIC is one of the largest single subsystems
src/quic/session.cc weighs in at over 100 KB. With the rest of src/quic/, src/node_http2.cc, src/crypto/crypto_tls.cc, and deps/ngtcp2/, Node ships its own substantial implementation of HTTP/1, HTTP/2, HTTP/3, and QUIC.
node ships npm, but they're separately maintained
deps/npm/ is just a copy of npm. Updates flow from the npm release line via tools/dep_updaters/. The same is true of corepack at deps/corepack/.
The .mailmap is enormous
.mailmap is 32 KB. After 17 years and ~ 4 300 unique committers, normalizing all the Name <email> permutations has become a maintenance task in its own right.
TODO/FIXME inventory
About 443 TODO, FIXME, or HACK comments live in src/ and lib/. The longest-standing entries (anchored to commits from the early 2010s) are concentrated in src/node_messaging.cc, lib/_http_outgoing.js, and src/tracing/. They survive because they describe non-trivial behavioural choices rather than concrete bugs.
You can build a Node binary that contains your app
tools/snapshot/ and the --build-snapshot flag let you embed a user-defined V8 snapshot. SEA goes one step further: it injects a payload section into a copy of the node binary so your app is self-contained. See systems › single-executable-applications.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.