-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
27 lines (24 loc) · 842 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
* A Node.js module to get commits and repos counts from Bitbucket, GitHub & GitLab
*
* The main file where the all the public functions are exported
*
* @author Jahidul Pabel Islam <[email protected]>
* @copyright (c) 2010 - 2022 JPI
* @license: GPL-3.0
*/
const BitbucketCounter = require("./lib/BitbucketCounter");
const GitHubCounter = require("./lib/GitHubCounter");
const GitLabCounter = require("./lib/GitLabCounter");
// Wrapper function to only expose main getter function to public use!
const exposer = function(counterClass) {
return function(config) {
const counter = new counterClass(config);
return counter.get();
};
};
module.exports = {
getBitbucketCounts: exposer(BitbucketCounter),
getGitHubCounts: exposer(GitHubCounter),
getGitLabCounts: exposer(GitLabCounter),
};