-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
35 lines (29 loc) · 973 Bytes
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* (C) Copyright 2014 Travis Miller (http://raceconditions.net/).
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser General Public License
* (LGPL) version 2.1 which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-2.1.html
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
var fs = require('fs');
var Config = function() {
self = this;
this.readConfiguration = function() {
var configData = fs.readFileSync('./config.json');
try {
config = JSON.parse(configData);
return config;
}
catch (err) {
console.log('ERROR parsing configuration file.', err);
process.exit(2);
}
};
};
module.exports = Config;