bash-conf
Read a simple bash config file (simple variables and values) and convert into a Javascript object.
This allows you to keep API keys, Database names etc out your source code and in a shareable location that both bash and node scripts can read.
Example config
It's intended to read a simple text file like this:
EMPTY_VAR=FOO=BARthis line will be ignored
Which has been used in a bash script like this:
# set vars
. /path/to/config/file.cfg
export FOO
Usage
var path = processargv 2 BashConf = bashConf = ; bashConf ;
Error Handling
Lines that don't match the regex pattern are simply ignored and not parsed.
Missing config path
$ node test.jsNo path supplied
Invalid config path
$ node test.js aintnofile.cfgCould not read conf file aintnofile.cfg