Modules, Runtime & Tooling
Node.js Runtime & Evented I/O
Node.js runs JavaScript outside the browser and provides host APIs for files, networking, processes, diagnostics, packages, and server-side execution. Its I/O model is evented: many operations are asynchronous so the process can keep handling other work.
- Node is a runtime, not the language
- Evented I/O keeps one process responsive
- CPU-heavy JavaScript still blocks the event loop
- Node has browser-like APIs but not a browser environment
- Operational Node code needs runtime discipline
import { readFile } from "node:fs/promises"
export async function readConfig(path: string) {
const text = await readFile(path, "utf8")
return JSON.parse(text) as unknown
}| Concept | Owned by | Example |
|---|---|---|
| Syntax and semantics | ECMAScript | let, class, Promise, modules |
| Engine | V8 | Parses and executes JavaScript |
| Runtime APIs | Node | fs, process, Buffer, streams |
| Package tooling | Node/npm ecosystem | npm scripts, node_modules |
| OS integration | Host system | signals, sockets, files |