github-org-stats
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -20,2 +20,16 @@ 'use strict'; | ||
this.authenticate = function () { | ||
return new Promise(function (resolve, reject) { | ||
try { | ||
_this.github.authenticate({ | ||
type: 'token', | ||
token: _this.token | ||
}); | ||
resolve(); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
}); | ||
}; | ||
this.getOrgRepos = function () { | ||
@@ -43,2 +57,4 @@ return _this.github.repos.getForOrg({ org: _this.org, per_page: 100 }); | ||
}; | ||
}, function (error) { | ||
return Promise.reject(error); | ||
}); | ||
@@ -51,9 +67,4 @@ }; | ||
this.github = (0, _github2.default)(); | ||
this.github.authenticate({ | ||
type: 'token', | ||
token: token | ||
}); | ||
}; | ||
exports.default = GithubOrgStats; |
{ | ||
"name": "github-org-stats", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Gather statistics for your github organization", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -34,4 +34,4 @@ # github-org-stats | ||
"totalStars": 3084, | ||
"repos": [ { "name": 'grommet', "stars": 2543 }, ... ], | ||
"repos": [ { "name": "grommet", "stars": 2543 } ], | ||
} | ||
``` |
@@ -9,6 +9,14 @@ import Github from 'github'; | ||
this.github = Github(); | ||
this.github.authenticate({ | ||
type: 'token', | ||
token: token, | ||
} | ||
authenticate = () => { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
this.github.authenticate({ | ||
type: 'token', | ||
token: this.token, | ||
}); | ||
resolve(); | ||
} catch(e) { | ||
reject(e); | ||
} | ||
}); | ||
@@ -33,4 +41,4 @@ } | ||
} | ||
}); | ||
}, error => Promise.reject(error)); | ||
} | ||
} |
@@ -8,2 +8,6 @@ import GithubOrgStats from '../src/GithubOrgStats'; | ||
githubOrgStats.get().then(result => console.log(result)); | ||
githubOrgStats | ||
.authenticate() | ||
.then(() => githubOrgStats.get()) | ||
.then(result => console.log(result)) | ||
.catch(error => console.log(error)); |
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
81606
113
2