UNPKG

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