DEV Community

Discussion on: Please don't commit .env

Collapse
 
somedood profile image
Basti Ortiz • Edited

Hm, I would recommend adding an .env.sample file in the repository. Instead of filling in the fields with real values, you can add placeholders, redactions, and "pseudo-values".

Then, of course, this would have to be documented and explained in the appropriate README.md.

Or perhaps, you could even forgo the .env.sample file and declare the environment variables in the README.md itself, but I personally prefer the former because it is more explicit.

# .env.sample
NODE_ENV=<production|development>
PORT=<open-port>
API_KEY=<github-key>

# And so on and so forth...
Enter fullscreen mode Exit fullscreen mode