github-oss-contributions
v1.5.0
Published
Fetch organizations where a user created issues or PRs
Readme
✨ Features
- 🚀 Organization name
- 🖼️ Avatar image
- 🔗 Profile URL
- 📝 List of Issues and PRs grouped by organization
📦 Installation
npm install -g github-oss-contributions🚦 CLI Usage
github-oss-contributions --username <github-username> [--token <your-github-token>] [--json]CLI Options
--username <github-username>(required): The GitHub username to fetch contributions for.--token <your-github-token>(optional): A GitHub personal access token for higher rate limits and private data.--json(optional): Output the results as JSON instead of formatted text.
Example Commands
Formatted Output:
github-oss-contributions --username anuj123upadhyayWith Token:
github-oss-contributions --username anuj123upadhyay --token <your-github-token>JSON Output:
github-oss-contributions --username anuj123upadhyay --json🛠️ API Usage
You can use this package programmatically in Node.js:
const GitHubOssContributions = require('github-oss-contributions');
// Token is optional
const client = new GitHubOssContributions('anuj123upadhyay', '<your_token>');
// Get all OSS organization contributions
client.getContributions().then(data => {
console.log(data);
});API Reference
constructor(username, token = null)
Creates a new client for the given GitHub username. Token is optional.
async getContributions()
Fetches all organizations where the user has created issues or PRs. Returns an object:
{
ORG_NAME: {
avatar_url: '...',
profile_url: '...',
issues: [ { title, url } ],
prs: [ { title, url } ]
},
...
}async search(query, type)
Searches GitHub issues or PRs for the user. Used internally.
async isOrg(owner)
Checks if a repository owner is an organization. Used internally.
👨💻 Example Output
🤝 Authors
- Anuj Kumar Upadhyay
- Mohit Upadhyay
📝 License
MIT
