Skip to content

Instantly share code, notes, and snippets.

@Strajk
Created February 5, 2018 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Strajk/6903324e5a69b7310c9ce67cba394686 to your computer and use it in GitHub Desktop.
Save Strajk/6903324e5a69b7310c9ce67cba394686 to your computer and use it in GitHub Desktop.
Gitlab with promises
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