Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fetchGitRepositoryInfo = async () => {
- try {
- const [owner, repoName] = gitHubRepoLink.split('/').slice(+2);
- const response = await fetch('https://api.github.com/repos/${owner}/${repoName}');
- if(!response.ok){
- console.error('GitHub API Error', response.statusText);
- return;
- }
- const repoInfo = await response.json();
- const issuesCount = repoInfo.open_issues_count;
- const totalDownloads = repoInfo.watchers_count;
- const lastUpdate = new Date(repoInfo.updated_at).toLocaleDateString();
- }catch(error){
- console.error('Error fetching GitHub repo info', error)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement