Joodi

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

Enter fullscreen mode Exit fullscreen mode

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)

Subscribe

Code of Conduct Report abuse

For further actions, you may consider blocking this person and/or reporting abuse