DEV Community

Joodi
Joodi

Posted on

No More nodemon or dotenv? Node.js Can Handle It Now

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)