To get your personal access token you can refer this guide creating-a-personal-access-token
npm install github-user-contribution-summary
#OR
yarn add github-user-contribution-summaryimport { getContributionSummary } from 'github-user-contribution-summary';
const getUserContributionSummary = async () => {
const argument = {
userName: 'Sachin-chaurasiya',
githubToken: '',
};
try {
const response = await getContributionSummary(
argument
);
console.log(response);
} catch (error) {
console.log('Something went wrong', error);
}
};
getUserContributionSummary();
// Output
{
"totalContributionCount": 3287,
"contributionByDate": [
{
"contributionCount": 5,
"date": "2022-11-18"
},
...
],
"totalPullRequests": 705,
"totalIssues": 316,
"totalStarredRepositories": 171,
"totalRepositoriesContributedTo": 31,
"totalRepositories": 60,
"totalGists": 3,
"totalFollowers": 63,
"totalPullRequestReviewed": 604
}import { getPullRequestCountByState } from 'github-user-contribution-summary'
const getPullRequestCount = async () => {
try {
const data = await getPullRequestCountByState(
{
userName: 'Sachin-chaurasiya',
githubToken: '',
},
'MERGED'
);
console.log(data);
} catch (error) {
console.log('error', error);
}
};
getPullRequestCount();
// Output
{ state: 'MERGED', count: 671 }import { getIssueCountByState } from 'github-user-contribution-summary'
const getIssueCount = async () => {
try {
const data = await getIssueCountByState(
{
userName: 'Sachin-chaurasiya',
githubToken: '',
},
'CLOSED'
);
console.log(data);
} catch (error) {
console.log('error', error);
}
};
getIssueCount();
// Output
{ state: 'CLOSED', count: 301 }const { getContributionSummary } = require('github-user-contribution-summary');
const getUserContributionSummary = async () => {
const argument = {
userName: 'Sachin-chaurasiya',
githubToken: '',
};
try {
const response = await getContributionSummary(
argument
);
console.log(response);
} catch (error) {
console.log('Something went wrong', error);
}
};
getUserContributionSummary();
// Output
{
"totalContributionCount": 3287,
"contributionByDate": [
{
"contributionCount": 5,
"date": "2022-11-18"
},
...
],
"totalPullRequests": 705,
"totalIssues": 316,
"totalStarredRepositories": 171,
"totalRepositoriesContributedTo": 31,
"totalRepositories": 60,
"totalGists": 3,
"totalFollowers": 63,
"totalPullRequestReviewed": 604
}Before starting, please check the Contribution Guide to get started.
First, you need to fork the github-user-contribution-summary repo. You can do this by clicking the Fork button on the top right corner of the repo. If you are new to forking, please watch this YouTube Guide to get started.
Once forked, you can clone the repo by clicking the Clone or Download button on the top right corner of the forked repo.
Please change the directory after cloning the repository using the cd <folder-name> command.
Next, install the dependencies by running the following command in the github-user-contribution-summary repo:
npm installOr
yarn installUse the following command to build the package:
npm run buildOr
yarn buildIt builds the package for production to the lib folder.
We value all contributions, no matter their size! To get started, please refer to our CONTRIBUTING guide, and don't hesitate to reach out to us for any assistance you may need.
If you don't want to miss any updates, please show your support by giving the project a ⭐ 🚀.
We extend a massive THANK YOU to all our supporters!