Write ES modules. Express 5 24,430 is CommonJS internally but exports cleanly to import, as does every package in this chapter. Set "type": "module" once and keep the rules from type and File Extensions in mind: relative specifiers keep their file extension (./routes/books.js), and the default export arrives as import express from 'express' while named helpers come as import { Router } from 'express'.
You do not need nodemon 26,658 any more. node --watch src/server.js restarts the process whenever a loaded file changes, printing Restarting 'src/server.js' and then your listen message. --watch-path=src narrows the watch and --env-file=.env loads environment variables without dotenv 20,543 , together replacing three dev dependencies a 2022 tutorial would have had you install.
TypeScript needs no build step either. Node strips type annotations natively (Native Type Stripping), so a file with app.get('/health', (req: Request, res: Response) => ...) runs under plain node server.ts. Install @types/express 5.0.6 for editor completion — the 4.x types mis-describe req.params — and run tsc --noEmit in CI, since stripping erases annotations rather than verifying them.