DEV Community

Discussion on: Please don't commit .env

Collapse
 
somedood profile image
Basti Ortiz

Yes, that's true. At least for me, I think it's just easier to have a .env file because it requires minimal setup and messing around with global configurations.

At least in Node.js, all you have to do is npm install and require the dotenv package. Then in your code, just invoke the dotenv.config() and it should all be running smoothly via the process.env object. This way just saves you from the little extra effort you have to do with the nitty-gritty configurations.

But to each its own. Whatever workflow works the best for you, you should apply it, not because everyone does it but because you feel productive with it.