Created
February 5, 2018 21:10
-
-
Save Strajk/6903324e5a69b7310c9ce67cba394686 to your computer and use it in GitHub Desktop.
Gitlab with promises
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gitlab = require('gitlab')({ | |
url: process.env.GITLAB_URL, | |
token: process.env.GITLAB_TOKEN | |
}) | |
const promisifier = function (fn) { | |
return function (...args) { | |
return new Promise(resolve => { | |
args.push(resolve); | |
fn.apply(this, args); | |
}); | |
} | |
}; | |
bluebird.promisifyAll(gitlab.projects, {suffix: "Async", promisifier}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment