Commit da9a9bd0119b699e580a88db217bdb72c2ccec40
1 parent
186291b110
Exists in
master
config-ini.js
Showing 1 changed file with 13 additions and 0 deletions Side-by-side Diff
config-ini.js
... | ... | @@ -0,0 +1,13 @@ |
1 | +"use strict"; | |
2 | + | |
3 | +const fs = require('fs'); | |
4 | +const ini = require('ini'); | |
5 | + | |
6 | +const configFile = process.cwd() + '/config.ini'; | |
7 | +if (!fs.existsSync(configFile)) { | |
8 | + console.trace('Config file not found. Terminating'); | |
9 | + process.exit(1); | |
10 | +} | |
11 | +const config = ini.parse(fs.readFileSync(configFile, 'utf-8')); | |
12 | + | |
13 | +module.exports = config; |