DEV Community

Discussion on: Parsing Config Files The Right Way

Collapse
 
dmerejkowsky profile image
Dimitri Merejkowsky

All good advice, and the link about pros and cons about environment variables is very interesting.

But note that the context is a bit different: the 12 factor app is a software as a service, and my article is about a command-line tool.

Also, you're right, if you're using Javascript already, having config files in json (or even in javascript code!) is certainly a good idea.

Collapse
 
bgadrian profile image
Adrian B.G.

Sorry, my bad. I thought the app is nodejs web based.

When you start using hosting services, and your team is getting bigger, project grow, I always hit the config files problem.

You can also fix some of the "cons" of ENV vars by using a stub file with all the ENV vars, that can also be used as local DEV env. Some hostings also allows keeping ENV vars in files, but beats the purpose.