John John - 2 years ago 95
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 Source

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

alias node='node -r ./config.js'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download