@techtalkers/github
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -6,2 +6,3 @@ import { GithubMetadata } from '@techtalkers/types'; | ||
}>; | ||
export { fetchGithubData }; | ||
declare function checkValidUsernName(username: string): Promise<Boolean>; | ||
export { fetchGithubData, checkValidUsernName }; |
@@ -79,2 +79,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
export { fetchGithubData }; | ||
function checkValidUsernName(username) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const data = yield fetch(`https://api.github.com/users/${username}`); | ||
if (!data.ok) { | ||
console.error(`Failed to fetch Github metadata for ${username} ${data.status}`); | ||
return false; | ||
} | ||
else { | ||
return true; | ||
} | ||
}); | ||
} | ||
export { fetchGithubData, checkValidUsernName }; |
{ | ||
"name": "@techtalkers/github", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A package to extract github metadata and total contributions for a github user.", | ||
@@ -8,3 +8,5 @@ "type": "module", | ||
"scripts": { | ||
"start": " npx tsc && node dist/index.js" | ||
"start": " npx tsc && node dist/index.js", | ||
"build": "npx tsc", | ||
"check-types": "tsc --noEmit" | ||
}, | ||
@@ -11,0 +13,0 @@ "keywords": [ |
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
5301
6
98
4