I'm developing server side app on Node.js and I thinking about config
file usage. But when I google it.. well as for now I have more questions then answers.
In my case I have a-lot-of functions with arguments different types of
sensitivity
not just onlysecret, tokens, keys
. Most of this argument as user-depended. For example, user that launch app use to define (via CLI [promtly]): number of days, how much times something will execute, when and where, etc
For example I just check this question and that article. And my question is simple:
Which one to use and why? (or where can I read more about it) Using only
.env
file, or onlyconfig.json
or probably both like in article above? Is it OK to store all settings inpackage.json
or not? (like in this question)
I'd be very pleased if more experienced JS devs tell me what should I use and why.
Even if this question is marked as answered
feel free to tell me (and everyone on SO) about your experience with such problem. But please, remember, that I'm asking not about *How to do it*
or about DotEnv usage (or any other npm module). It's all about patterns & practices.