{"_id":"@c0dez/github-repo-fetcher","_rev":"1-e8bc0254b15d0e55498ea0d8b298b197","name":"@c0dez/github-repo-fetcher","dist-tags":{"latest":"3.0.1"},"versions":{"3.0.0":{"name":"@c0dez/github-repo-fetcher","version":"3.0.0","keywords":["github","api","readme","repositories","github-api","github-stats","profile-analysis","typescript","repo-fetcher","github-metrics"],"author":{"url":"https://github.com/C0DE-Z","name":"C0DEZ"},"license":"MIT","_id":"@c0dez/github-repo-fetcher@3.0.0","maintainers":[{"name":"c0de-z","email":"melonicholas1113@gmail.com"}],"homepage":"https://github.com/C0DE-Z/github-repo-fetcher#readme","bugs":{"url":"https://github.com/C0DE-Z/github-repo-fetcher/issues"},"dist":{"shasum":"1a002de89a65ab17ad9a718951b8bf780fac41a9","tarball":"https://registry.npmjs.org/@c0dez/github-repo-fetcher/-/github-repo-fetcher-3.0.0.tgz","fileCount":12,"integrity":"sha512-gZ9H4hoWUP9RnaU5yaCDlwzeQ0qqw0w4lEauIV9542HjMRPJrxJzQY9/57DOis+36SzQWqkZH8ccVinLHD+bXA==","signatures":[{"sig":"MEUCIQCllacIRk86yAF7J271KGmRgE6e85KXwRwK00naAoZGtQIgcQQ/ZFg27sOmAV3wJhj1furNggOT6OOKh70ycnMG94I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17485},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"b7c38b02c65c8a2369086456cfad0fd5bb30b48e","scripts":{"test":"jest","build":"tsc","example":"npx ts-node src/example.ts","prepare":"npm run build","test:watch":"jest --watch"},"_npmUser":{"name":"c0de-z","email":"melonicholas1113@gmail.com"},"repository":{"url":"git+https://github.com/C0DE-Z/github-repo-fetcher.git","type":"git"},"_npmVersion":"11.1.0","description":"🔍 A lightweight GitHub profile analyzer that fetches repositories, READMEs, and comprehensive user statistics with TypeScript support. Perfect for building GitHub analytics tools and portfolio sites.","directories":{},"_nodeVersion":"23.1.0","dependencies":{"axios":"^1.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","ts-jest":"^29.1.0","ts-node":"^10.9.2","typescript":"^4.9.5","@types/jest":"^29.5.0","@types/node":"^18.16.0"},"_npmOperationalInternal":{"tmp":"tmp/github-repo-fetcher_3.0.0_1740165476077_0.22052293293040348","host":"s3://npm-registry-packages-npm-production"}},"3.0.1":{"name":"@c0dez/github-repo-fetcher","version":"3.0.1","description":"🔍 A lightweight GitHub profile analyzer that fetches repositories, READMEs, and comprehensive user statistics with TypeScript support. Perfect for building GitHub analytics tools and portfolio sites.","keywords":["github","api","readme","repositories","github-api","github-stats","profile-analysis","typescript","repo-fetcher","github-metrics"],"homepage":"https://github.com/C0DE-Z/github-repo-fetcher#readme","bugs":{"url":"https://github.com/C0DE-Z/github-repo-fetcher/issues"},"repository":{"type":"git","url":"git+https://github.com/C0DE-Z/github-repo-fetcher.git"},"license":"MIT","author":{"name":"C0DEZ","url":"https://github.com/C0DE-Z"},"type":"commonjs","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","prepare":"npm run build","test":"jest","test:watch":"jest --watch","example":"npx ts-node src/example.ts"},"dependencies":{"axios":"^1.4.0"},"devDependencies":{"@types/jest":"^29.5.0","@types/node":"^18.16.0","jest":"^29.5.0","ts-jest":"^29.1.0","ts-node":"^10.9.2","typescript":"^4.9.5"},"publishConfig":{"access":"public"},"_id":"@c0dez/github-repo-fetcher@3.0.1","gitHead":"b7c38b02c65c8a2369086456cfad0fd5bb30b48e","_nodeVersion":"23.1.0","_npmVersion":"11.1.0","dist":{"integrity":"sha512-c6pvyOZB1k0SUavXWonkrOZcH+kQBDH2i1ZjMl3jmDV9z80H2TTAI6ugPyqFUdoBiuVg8gdyWCr9M0DgMdzhcw==","shasum":"440121388f7d54e6e90fb2a8af3e8f0f3c5e8e6e","tarball":"https://registry.npmjs.org/@c0dez/github-repo-fetcher/-/github-repo-fetcher-3.0.1.tgz","fileCount":12,"unpackedSize":17475,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEMCHwFDxIWjOw1Ady6Ah5mIpVuYTgmLjAUFmjXMl+xroTwCIGbDGJV40LN/HHB/l0Lf/H9KmYBDCf1ECThMKvOGh6oL"}]},"_npmUser":{"name":"c0de-z","email":"melonicholas1113@gmail.com"},"directories":{},"maintainers":[{"name":"c0de-z","email":"melonicholas1113@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/github-repo-fetcher_3.0.1_1740165651824_0.09371642613512954"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-21T19:17:56.015Z","modified":"2025-02-21T19:20:52.223Z","3.0.0":"2025-02-21T19:17:56.245Z","3.0.1":"2025-02-21T19:20:52.031Z"},"bugs":{"url":"https://github.com/C0DE-Z/github-repo-fetcher/issues"},"author":{"name":"C0DEZ","url":"https://github.com/C0DE-Z"},"license":"MIT","homepage":"https://github.com/C0DE-Z/github-repo-fetcher#readme","keywords":["github","api","readme","repositories","github-api","github-stats","profile-analysis","typescript","repo-fetcher","github-metrics"],"repository":{"type":"git","url":"git+https://github.com/C0DE-Z/github-repo-fetcher.git"},"description":"🔍 A lightweight GitHub profile analyzer that fetches repositories, READMEs, and comprehensive user statistics with TypeScript support. Perfect for building GitHub analytics tools and portfolio sites.","maintainers":[{"name":"c0de-z","email":"melonicholas1113@gmail.com"}],"readme":"# GitHub Repo Fetcher\r\n\r\nA simple Node.js module to fetch GitHub repositories, READMEs, and user statistics for a given profile.\r\n\r\n## Features\r\n- Fetch user's repositories and their READMEs\r\n- Get comprehensive user statistics\r\n- Language usage analysis\r\n- Star count and contribution metrics\r\n- TypeScript support\r\n\r\n## Quick Start\r\n\r\n### Installation\r\n\r\n```bash\r\n# Using npm\r\nnpm install github-repo-fetcher\r\n\r\n# Using yarn\r\nyarn add github-repo-fetcher\r\n```\r\n\r\n### Basic Usage\r\n\r\n```typescript\r\nimport { GitHubRepoFetcher } from 'github-repo-fetcher';\r\n\r\nasync function main() {\r\n    // Initialize (token is optional but recommended for higher rate limits)\r\n    const fetcher = new GitHubRepoFetcher('your-github-token');\r\n    \r\n    try {\r\n        // Get user stats\r\n        const stats = await fetcher.getUserStats('octocat');\r\n        console.log('User Stats:', stats);\r\n        \r\n        // Get repositories with READMEs\r\n        const repos = await fetcher.getReposWithReadme('octocat');\r\n        console.log('Repositories:', repos);\r\n    } catch (error) {\r\n        console.error('Error:', error);\r\n    }\r\n}\r\n\r\nmain();\r\n```\r\n\r\n### CLI Example\r\n\r\n```bash\r\n# Install dependencies\r\nnpm install\r\n\r\n# Run the example script\r\nnpm run example <github-username>\r\n\r\n# Example\r\nnpm run example octocat\r\n```\r\n\r\n## GitHub Token\r\n\r\nWhile the module works without a token, it's recommended to use one to avoid rate limiting.\r\n\r\n1. Go to GitHub Settings → Developer settings → Personal access tokens\r\n2. Generate a new token with `repo` and `user` scopes\r\n3. Use the token when initializing:\r\n\r\n```typescript\r\nconst fetcher = new GitHubRepoFetcher('your-github-token');\r\n```\r\n\r\n## API Reference\r\n\r\n### GitHubRepoFetcher Class\r\n\r\n```typescript\r\nclass GitHubRepoFetcher {\r\n    constructor(token?: string);\r\n    async getReposWithReadme(username: string): Promise<GitHubRepo[]>;\r\n    async getUserStats(username: string): Promise<GitHubUserStats>;\r\n}\r\n```\r\n\r\n### Response Types\r\n\r\n```typescript\r\ninterface GitHubRepo {\r\n    name: string;\r\n    full_name: string;\r\n    description: string | null;\r\n    html_url: string;\r\n    readme?: string;\r\n    stargazers_count: number;\r\n}\r\n\r\ninterface GitHubUserStats {\r\n    login: string;\r\n    name: string | null;\r\n    bio: string | null;\r\n    public_repos: number;\r\n    followers: number;\r\n    following: number;\r\n    location: string | null;\r\n    blog: string | null;\r\n    twitter_username: string | null;\r\n    created_at: string;\r\n    updated_at: string;\r\n    contributions?: number;\r\n    languages?: { [key: string]: number };\r\n    totalStars?: number;\r\n}\r\n```\r\n\r\n## Development\r\n\r\n```bash\r\n# Clone the repository\r\ngit clone <repository-url>\r\ncd github-repo-fetcher\r\n\r\n# Install dependencies\r\nnpm install\r\n\r\n# Build\r\nnpm run build\r\n\r\n# Run tests\r\nnpm test\r\n\r\n# Watch mode for tests\r\nnpm run test:watch\r\n```\r\n\r\n## Error Handling\r\n\r\nThe module includes built-in error handling:\r\n\r\n```typescript\r\ntry {\r\n    const stats = await fetcher.getUserStats('non-existent-user');\r\n} catch (error) {\r\n    console.error(error.message); // Will contain GitHub API error message\r\n    console.error(error.status);  // Will contain HTTP status code\r\n}\r\n```\r\n\r\n## Rate Limiting\r\n\r\nGitHub API has rate limits:\r\n- Authenticated requests: 5,000 requests per hour\r\n- Unauthenticated requests: 60 requests per hour\r\n\r\n## License\r\n\r\nMIT\r\n\r\n## Contributing\r\n\r\n1. Fork the repository\r\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\r\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\r\n4. Push to the branch (`git push origin feature/amazing-feature`)\r\n5. Open a Pull Request\r\n","readmeFilename":"README.md"}