MCPcopy Create free account
hub / github.com/NiladriHazra/WhatToBuild / getRepositoryStats

Method getRepositoryStats

lib/github.ts:220–243  ·  view source on GitHub ↗
(owner: string, repo: string)

Source from the content-addressed store, hash-verified

218 }
219
220 async getRepositoryStats(owner: string, repo: string) {
221 try {
222 const [repoResponse, contributorsResponse, commitsResponse] = await Promise.all([
223 axios.get(`${this.baseURL}/repos/${owner}/${repo}`, { headers: this.getHeaders() }),
224 axios.get(`${this.baseURL}/repos/${owner}/${repo}/contributors`, {
225 headers: this.getHeaders(),
226 params: { per_page: 5 }
227 }),
228 axios.get(`${this.baseURL}/repos/${owner}/${repo}/commits`, {
229 headers: this.getHeaders(),
230 params: { per_page: 10 }
231 })
232 ]);
233
234 return {
235 repo: repoResponse.data,
236 topContributors: contributorsResponse.data,
237 recentCommits: commitsResponse.data
238 };
239 } catch (error) {
240 console.error('GitHub stats error:', error);
241 return null;
242 }
243 }
244
245 async getReadme(repoFullName: string): Promise<string> {
246 try {

Callers 2

GETFunction · 0.95
GETFunction · 0.95

Calls 1

getHeadersMethod · 0.95

Tested by

no test coverage detected