-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpdns.js
More file actions
30 lines (24 loc) · 671 Bytes
/
pdns.js
File metadata and controls
30 lines (24 loc) · 671 Bytes
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
var fs = require('fs');
var libPath = __dirname + '/modules';
var PDNS = function (options) {
var _this = this;
this.utils = require('./lib/utils');
['apiKey', 'host'].forEach(function (required) {
if (!options[required]) {
throw new Error('options.' + required + ' is a required argument.');
}
});
this.config = options;
this.authorized = false;
// Add all the modules
var files = fs.readdirSync(libPath);
var i = 0;
var len = files.length;
while (i < len) {
var name = files[i].replace('.js', '');
var Item = require(libPath + '/' + name);
_this[name] = new Item(this.config);
i++;
}
};
module.exports = PDNS;