`fs` reads and writes the filesystem in three flavours: synchronous (`readFileSync`, blocks the event loop), callback-based (`readFile(path, cb)`), and promise-based via `fs/promises`.
js
import { readFile, writeFile } from "node:fs/promises";
const config = JSON.parse(await readFile("./config.json", "utf8"));
await writeFile("./out.json", JSON.stringify({ ok: true }, null, 2));Prefer the async APIs on servers: a synchronous read blocks every other request being handled on that same event loop. Sync APIs are fine for one-off scripts and startup-time config loading, where blocking briefly at boot is harmless.