(filename)
| 45 | } |
| 46 | |
| 47 | function loadConfigurationFile(filename) { |
| 48 | debug(`Loading configuration from ${filename}`); |
| 49 | try { |
| 50 | return JSON.parse(fs.readFileSync(filename, 'utf8')); |
| 51 | } catch (e) { |
| 52 | throw new Error( |
| 53 | `Problem reading config from file "${filename}". Error was ${e.message}`, |
| 54 | e |
| 55 | ); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | function configure(configurationFileOrObject) { |
| 60 | if (enabled) { |