You might not need two popular packages in your Node.js projects anymore.
- Since Node.js 20.6, Node can load .env files natively with --env-file.
- And since Node.js 22, --watch is stable for automatic restarts.
node --env-file=.env --watch app.js
Thatβs it.
- No dotenv.
- No nodemon.
- No extra setup.
For a simple Node.js app, the runtime can now handle both.
Of course, nodemon and dotenv still make sense if you need their extra features.
π Official Node.js docs: Node.js CLI documentation

Top comments (0)