Node.js updates: No more dotenv, nodemon needed

𝗡𝗼𝗱𝗲.𝗷𝘀 𝗝𝘂𝘀𝘁 𝗠𝗮𝗱𝗲 𝗧𝘄𝗼 𝗼𝗳 𝗢𝘂𝗿 𝗙𝗮𝘃𝗼𝗿𝗶𝘁𝗲 𝗣𝗮𝗰𝗸𝗮𝗴𝗲𝘀 𝗢𝗽𝘁𝗶𝗼𝗻𝗮𝗹 If you’ve been working with Node for a while, you’ve probably used dotenv to load environment variables and nodemon to auto-restart your app during development. Well, guess what? The latest Node.js updates just made both of them (mostly) unnecessary. 1. Native .env Support Now you can simply run: node --env-file=.env index.js No dotenv required. Node will automatically load your environment variables from the .env file. You can even chain multiple files for different environments: node --env-file=.env --env-file=.env.local index.js 2. Built-in File Watching Node now comes with a native watcher — meaning you can finally say goodbye to nodemon: node --watch index.js Save your file, and Node restarts automatically. Clean and fast. Why This Matters Fewer dependencies → lighter package.json Cleaner scripts → no need for external reloaders Easier DevOps integration → same flags work in local or CI/CD Faster onboarding for new devs No more nodemon or dotenv 🧠 How I’ve Started Using It I recently refactored one of my Node projects and replaced this 👇 "dev": "nodemon -r dotenv/config src/index.js" with this 👇 "dev": "node --watch --env-file=.env src/index.js" It felt refreshingly modern — fewer packages, same functionality, and better performance. 🔮 My Take Node.js is finally becoming self-sufficient. What used to need a handful of helper packages is now just one clean CLI command away. If you’re still relying on nodemon or dotenv, try these flags on your next project — you might not go back. 💬 What do you think — will you drop nodemon and dotenv in your workflow? #NodeJS #JavaScript #BackendDevelopment #FullStack #DevOps #WebDevelopment

To view or add a comment, sign in

Explore content categories