We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.
Thanks for sharing this :) this is useful!
Hi,do you know what is the scope of application environment variables in nodejs? are scoped only to the running app. for example if pass an environment variable at startup or set an variable in .env fail. can this variable be access outside of my app. I ask this for security reasons.
Hi Alex! They should only be accessible for that process and any child processes (unless you explicitly pass a different "environment" to the child process on creation). Therefore they should not be accessible outside your app. It's the same as if you would open two terminal windows, write into one `export FOO=bar` and then try to `echo $FOO` in both windows. one will have it defined the other one doesn't.
Check out `good-env` for boolean/number parsing plus default values https://github.com/recursiv...
Ouh nice! That looks like a useful helper :) Thanks for sharing this!
I prefer manage my env vars using docker-compose (using `env_file` directive)
Thanks for this great article, I have had some new learnings.
How can one combine your nodenv module with nodemon?
It is 'if-env NODE_ENV=production &&' NOT '"if-env NODE_ENV=production ??'
If you are interested to use environment variables as configuration parameters for your libraries you can check a library I wrote: https://github.com/yatki/re...
It's pretty handy.
A handy package that complements `dotenv` is `dotenvenc`. It will create an encrypted version `.envenc` from your `.env` that you can place under version control so you can safely share sensitive secrets and passwords with your team.