{"id":16234915,"url":"https://github.com/sachin-chaurasiya/github-user-contribution-summary","last_synced_at":"2025-03-19T15:30:37.311Z","repository":{"id":65150703,"uuid":"583894604","full_name":"Sachin-chaurasiya/github-user-contribution-summary","owner":"Sachin-chaurasiya","description":"A library with utilities to get the GitHub user contribution summary by username.","archived":false,"fork":false,"pushed_at":"2024-05-15T18:21:19.000Z","size":45,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T19:27:10.905Z","etag":null,"topics":["github","github-con","javascript","npm","npm-package","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/github-user-contribution-summary","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sachin-chaurasiya.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"license","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["Sachin-chaurasiya"]}},"created_at":"2022-12-31T10:58:06.000Z","updated_at":"2024-05-15T18:21:23.000Z","dependencies_parsed_at":"2024-05-16T06:28:30.758Z","dependency_job_id":"b5eccc4c-caeb-49b3-9e84-763778c2a1bb","html_url":"https://github.com/Sachin-chaurasiya/github-user-contribution-summary","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"d1dc08253d6f916bef75b5e974c94cd0b9c520d5"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sachin-chaurasiya%2Fgithub-user-contribution-summary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sachin-chaurasiya%2Fgithub-user-contribution-summary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sachin-chaurasiya%2Fgithub-user-contribution-summary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sachin-chaurasiya%2Fgithub-user-contribution-summary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sachin-chaurasiya","download_url":"https://codeload.github.com/Sachin-chaurasiya/github-user-contribution-summary/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243999709,"owners_count":20381411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","github-con","javascript","npm","npm-package","typescript"],"created_at":"2024-10-10T13:17:58.170Z","updated_at":"2025-03-19T15:30:32.767Z","avatar_url":"https://github.com/Sachin-chaurasiya.png","language":"TypeScript","funding_links":["https://github.com/sponsors/Sachin-chaurasiya"],"categories":[],"sub_categories":[],"readme":"# Github User Contribution Summary\n\n\u003cdiv align=\"center\"\u003e\n\u003ch4 align=\"center\"\u003eA library with utilities to get the GitHub user contribution summary by username.\n\u003c/h4\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://ygc.sachinchaurasiya.dev\" target=\"blank\"\u003eView Demo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/Sachin-chaurasiya/github-user-contribution-summary/issues/new/choose\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/Sachin-chaurasiya/github-user-contribution-summary/issues/new/choose\"\u003eRequest Feature\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://www.npmjs.com/package/github-user-contribution-summary\" target=\"blank\"\u003e\n\u003cimg alt=\"Package-Version\" src=\"https://img.shields.io/github/package-json/v/Sachin-chaurasiya/github-user-contribution-summary?style=flat-square\"\u003e\n\u003c/a\u003e\n  \u003ca href=\"https://github.com/Sachin-chaurasiya/github-user-contribution-summary/blob/main/LICENSE\" target=\"blank\"\u003e\n\u003cimg src=\"https://img.shields.io/github/license/Sachin-chaurasiya/github-user-contribution-summary?style=flat-square\" alt=\"Your-Github-Contributions licence\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/Sachin-chaurasiya/github-user-contribution-summary/fork\" target=\"blank\"\u003e\n\u003cimg src=\"https://img.shields.io/github/forks/Sachin-chaurasiya/github-user-contribution-summary?style=flat-square\" alt=\"Your-Github-Contributions forks\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/Sachin-chaurasiya/github-user-contribution-summary/stargazers\" target=\"blank\"\u003e\n\u003cimg src=\"https://img.shields.io/github/stars/Sachin-chaurasiya/github-user-contribution-summary?style=flat-square\" alt=\"Your-Github-Contributions stars\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/Sachin-chaurasiya/github-user-contribution-summary/issues\" target=\"blank\"\u003e\n\u003cimg src=\"https://img.shields.io/github/issues/Sachin-chaurasiya/github-user-contribution-summary?style=flat-square\" alt=\"Your-Github-Contributions issues\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/Sachin-chaurasiya/github-user-contribution-summary/pulls\" target=\"blank\"\u003e\n\u003cimg src=\"https://img.shields.io/github/issues-pr/Sachin-chaurasiya/github-user-contribution-summary?style=flat-square\" alt=\"Your-Github-Contributions pull-requests\"/\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\n\u003e To get your personal access token you can refer this guide [creating-a-personal-access-token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)\n\n## Installation\n\n```bash\nnpm install github-user-contribution-summary\n\n#OR\n\nyarn add github-user-contribution-summary\n```\n\n## Usage\n\n### With ES6\n\n#### ContributionSummary\n\n```js\nimport { getContributionSummary } from 'github-user-contribution-summary';\n\nconst getUserContributionSummary = async () =\u003e {\n\n  const argument = {\n    userName: 'Sachin-chaurasiya',\n    githubToken: '',\n  };\n\n  try {\n    const response = await getContributionSummary(\n      argument\n    );\n    console.log(response);\n  } catch (error) {\n    console.log('Something went wrong', error);\n  }\n};\n\ngetUserContributionSummary();\n\n// Output\n\n{\n    \"totalContributionCount\": 3287,\n    \"contributionByDate\": [\n        {\n            \"contributionCount\": 5,\n            \"date\": \"2022-11-18\"\n        },\n        ...\n     ],\n    \"totalPullRequests\": 705,\n    \"totalIssues\": 316,\n    \"totalStarredRepositories\": 171,\n    \"totalRepositoriesContributedTo\": 31,\n    \"totalRepositories\": 60,\n    \"totalGists\": 3,\n    \"totalFollowers\": 63,\n    \"totalPullRequestReviewed\": 604\n}\n```\n\n#### Pull Request Count\n\n```js\nimport { getPullRequestCountByState } from 'github-user-contribution-summary'\n\nconst getPullRequestCount = async () =\u003e {\n  try {\n    const data = await getPullRequestCountByState(\n      {\n        userName: 'Sachin-chaurasiya',\n        githubToken: '',\n      },\n      'MERGED'\n    );\n\n    console.log(data);\n  } catch (error) {\n    console.log('error', error);\n  }\n};\n\ngetPullRequestCount();\n\n// Output\n\n{ state: 'MERGED', count: 671 }\n\n```\n\n#### Issue Count\n\n```js\nimport { getIssueCountByState } from 'github-user-contribution-summary'\n\nconst getIssueCount = async () =\u003e {\n  try {\n    const data = await getIssueCountByState(\n      {\n        userName: 'Sachin-chaurasiya',\n        githubToken: '',\n      },\n      'CLOSED'\n    );\n\n    console.log(data);\n  } catch (error) {\n    console.log('error', error);\n  }\n};\n\ngetIssueCount();\n\n// Output\n\n{ state: 'CLOSED', count: 301 }\n\n```\n\n### With CommonJs\n\n#### ContributionSummary\n\n```js\nconst  { getContributionSummary } = require('github-user-contribution-summary');\n\nconst getUserContributionSummary = async () =\u003e {\n\n  const argument = {\n    userName: 'Sachin-chaurasiya',\n    githubToken: '',\n  };\n\n  try {\n    const response = await getContributionSummary(\n      argument\n    );\n    console.log(response);\n  } catch (error) {\n    console.log('Something went wrong', error);\n  }\n};\n\ngetUserContributionSummary();\n\n// Output\n\n{\n    \"totalContributionCount\": 3287,\n    \"contributionByDate\": [\n        {\n            \"contributionCount\": 5,\n            \"date\": \"2022-11-18\"\n        },\n        ...\n     ],\n    \"totalPullRequests\": 705,\n    \"totalIssues\": 316,\n    \"totalStarredRepositories\": 171,\n    \"totalRepositoriesContributedTo\": 31,\n    \"totalRepositories\": 60,\n    \"totalGists\": 3,\n    \"totalFollowers\": 63,\n    \"totalPullRequestReviewed\": 604\n}\n```\n\n## How to Set up `github-user-contribution-summary` for Development?\n\nBefore starting, please check the [Contribution Guide](./CONTRIBUTING.md) to get started.\n\n### Fork and Clone the Repo\n\nFirst, 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](https://www.youtube.com/watch?v=h8suY-Osn8Q) to get started.\n\nOnce forked, you can clone the repo by clicking the `Clone or Download` button on the top right corner of the forked repo.\n\nPlease change the directory after cloning the repository using the `cd \u003cfolder-name\u003e` command.\n\n### Install Dependencies\n\nNext, install the dependencies by running the following command in the `github-user-contribution-summary` repo:\n\n```bash\nnpm install\n```\n\nOr\n\n```bash\nyarn install\n```\n\n\n### Build the package\n\nUse the following command to build the package:\n\n```bash\nnpm run build\n```\n\nOr\n\n```bash\nyarn build\n```\n\nIt builds the package for production to the `lib` folder.\n\n## Contributors\n\nWe value all contributions, no matter their size! To get started, please refer to our [CONTRIBUTING](./CONTRIBUTING.md) guide, and don't hesitate to reach out to us for any assistance you may need.\n\nIf you don't want to miss any updates, please show your support by giving the project a ⭐ 🚀.\n\nWe extend a massive THANK YOU to all our supporters!\n\n[![Stargazers repo roster for @Sachin-chaurasiya/github-user-contribution-summary](http://reporoster.com/stars/Sachin-chaurasiya/github-user-contribution-summary)](https://github.com/Sachin-chaurasiya/github-user-contribution-summary/stargazers)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsachin-chaurasiya%2Fgithub-user-contribution-summary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsachin-chaurasiya%2Fgithub-user-contribution-summary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsachin-chaurasiya%2Fgithub-user-contribution-summary/lists"}