Core Modules Overview
6 min read
Core Modules Overview
Node.js ships with a rich set of built-in (core) modules — no npm install required. They cover file system access, HTTP networking, streams, cryptography, OS information, path manipulation, and more. You load them with require("moduleName") or import.
fs— read, write, watch files and directoriespath— join, resolve, parse file paths cross-platformhttp/https— create HTTP(S) servers and make requestsos— CPU count, total memory, hostname, platformevents— EventEmitter class for pub/sub patternsstream— readable, writable, and transform streamscrypto— hashing, encryption, random bytesurl— parse and format URLsprocess— environment variables, argv, exit codeschild_process— spawn subprocesses and shell commands
In Node.js v14+ you can prefix core modules with node: (e.g. import fs from "node:fs") to make it explicit that you are importing a built-in, not an npm package.
Ready to test yourself?
Practice Node.js— quiz & coding exercises