1 | const { promise, callback } = require("../api/async.js");
|
2 | const sync = require("../api/sync");
|
3 |
|
4 | function APIBuilder(path, options) {
|
5 | this.dir = path;
|
6 | this.options = options;
|
7 | }
|
8 |
|
9 | APIBuilder.prototype.withPromise = function() {
|
10 | return promise(this.dir, this.options);
|
11 | };
|
12 |
|
13 | APIBuilder.prototype.withCallback = function(cb) {
|
14 | callback(this.dir, this.options, cb);
|
15 | };
|
16 |
|
17 | APIBuilder.prototype.sync = function() {
|
18 | return sync(this.dir, this.options);
|
19 | };
|
20 |
|
21 | module.exports = APIBuilder;
|