@techtalkers/github
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -0,2 +1,4 @@ | ||
import { GithubMetadata } from '@techtalkers/types'; | ||
declare function fetchTotalContributions(name: string): Promise<number>; | ||
export { fetchTotalContributions }; | ||
declare function fetchGithubMetadata(name: string): Promise<GithubMetadata | undefined>; | ||
export { fetchTotalContributions, fetchGithubMetadata }; |
@@ -54,2 +54,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
export { fetchTotalContributions }; | ||
function fetchGithubMetadata(name) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const data = yield fetch(`https://api.github.com/users/${name}`); | ||
if (!data.ok) { | ||
console.error(`Failed to fetch Github metadata for ${name} ${data.status}`); | ||
return; | ||
} | ||
else { | ||
const json = yield data.json(); | ||
return json; | ||
} | ||
}); | ||
} | ||
export { fetchTotalContributions, fetchGithubMetadata }; |
{ | ||
"name": "@techtalkers/github", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A package to extract github metadata and total contributions for a github user.", | ||
@@ -20,2 +20,3 @@ "type": "module", | ||
"devDependencies": { | ||
"@techtalkers/types": "^1.0.5", | ||
"@types/node": "^20.12.12", | ||
@@ -22,0 +23,0 @@ "typescript": "^5.4.5" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4259
71
3
3