1.0.3 โข Published 5 months ago
get-repo-insights v1.0.3
get-repo-insights ๐โจ๐ฅ
๐ Get Your GitHub Repository Insights Effortlessly โจ๐๐
get-repo-insights is a simple package that helps you fetch insights about your GitHub repositories, including metadata like stars, forks, and languages. It also allows you to retrieve specific files from your repositories. ๐๐ก๐
This package is built in a Bun environment, ensuring faster execution and optimized performance. โก๐ฐ๐
โจ Features ๐ฏ๐๐
- Fetch all repositories of a user with metadata
- Retrieve specific details of a particular repository
- Fetch specific file data from repositories
- Sort repositories by creation date (newest first)
- Simple and efficient API requests
๐ฆ Installation ๐ง๐ ๏ธโ๏ธ
npm i get-repo-insights
๐ Usage ๐๐กโก
Importing the package ๐ฆ๐โจ
import RepoInsights from "get-repo-insights";
Fetch all repositories of a user ๐๐๐
const fetcher = new RepoInsights("maxAnii");
fetcher.fetchInsights().then((repos) => console.log(repos));
Example Output ๐๐๐ฅ๏ธ
[
{
"name": "ProjectHarbor",
"description": "A powerful project management tool",
"topics": ["project-management", "tasks"],
"language": "TypeScript",
"repoURL": "https://github.com/maxAnii/ProjectHarbor",
"liveURL": "https://projectharbor.com",
"stars": 120,
"forks": 30,
"createdAt": "2023-05-15T10:00:00Z",
"updatedAt": "2024-02-25T08:00:00Z"
}
]
Fetch insights for a all repository ๐๐๐ก
const fetcher = new RepoInsights("maxAnii");
fetcher.fetchInsights().then((repo) => console.log(repo));
Fetch a specific file from all repositories ๐๐๐
const fetcher = new RepoInsights("maxAnii", "description.json");
fetcher.fetchInsights().then((files) => console.log(files));
Fetch a specific file from a particular repository ๐๐๐
const fetcher = new RepoInsights(
"maxAnii",
"description.json",
"ProjectHarbor"
);
fetcher.fetchInsights().then((file) => console.log(file));
๐ฅ Use Cases ๐๐ฏ๐ก
- Portfolio Integration: Fetch and display GitHub projects dynamically on a personal portfolio.
- Project Analytics: Analyze and compare repositories based on stars, forks, and languages.
- Repository Backup: Retrieve specific files from repositories for backup or migration.
- Showcasing Open Source Work: Display project insights directly in blogs or websites.
๐ License ๐โ๏ธโ
This project is licensed under the MIT License - see the LICENSE file for details.
๐ค Contributing ๐ก๐ป๐ฌ
Contributions are welcome! Feel free to open an issue or submit a pull request.
๐ฌ Support ๐ฉ๐๐ข
For any issues, check out the GitHub Issues or contact me at GitHub.