John John - 7 months ago 10
Bash Question

How to make node.js automatically load config files

In node.js, you can use 'require()'
to load your configuration files, but I am tired of having to do that on all my programs. Is there a way to make node.js automatically load config files?

Answer

Never mind. I found out you can do that by putting this in your '.bash_profile'

alias node='node -r ./config.js'