Skip to content

Commit 73c667e

Browse files
author
Dan Tolbert
committed
promsify all smartly
1 parent 5e36175 commit 73c667e

File tree

3 files changed

+1014
-0
lines changed

3 files changed

+1014
-0
lines changed

lib/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
var Promise = require("bluebird");
2+
13
module.exports = {
24
Client: require("./client"),
35
Site: require("./site"),
@@ -25,3 +27,10 @@ module.exports = {
2527
Dlda: require("./dlda"),
2628
ImportTnChecker: require("./importTnChecker")
2729
};
30+
31+
for (const property in module.exports) {
32+
Promise.promisifyAll(module.exports[property]);
33+
if (module.exports[property].hasOwnProperty("prototype")) {
34+
Promise.promisifyAll(module.exports[property].prototype);
35+
}
36+
}

0 commit comments

Comments
 (0)