{"id":21023507,"url":"https://github.com/jahidulpabelislam/contribution-counters","last_synced_at":"2025-05-15T08:32:57.553Z","repository":{"id":34915723,"uuid":"187418739","full_name":"jahidulpabelislam/contribution-counters","owner":"jahidulpabelislam","description":"Node module for repo's \u0026 commit's counter for GitHub, Bitbucket \u0026 GitLab.","archived":false,"fork":false,"pushed_at":"2024-09-06T23:15:02.000Z","size":292,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"2.x","last_synced_at":"2025-04-18T07:51:16.999Z","etag":null,"topics":["bitbucket-api","github-api","gitlab-api","nodejs","npm-package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/contribution-counters","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jahidulpabelislam.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-19T00:47:47.000Z","updated_at":"2024-09-06T23:15:05.000Z","dependencies_parsed_at":"2024-03-28T22:22:21.729Z","dependency_job_id":"fd92aa22-28cc-4caa-a5bd-964aa7339c19","html_url":"https://github.com/jahidulpabelislam/contribution-counters","commit_stats":{"total_commits":190,"total_committers":6,"mean_commits":"31.666666666666668","dds":"0.37368421052631584","last_synced_commit":"854d3ce03680f65800abe4a70ccddbb7bc8f22c1"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jahidulpabelislam%2Fcontribution-counters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jahidulpabelislam%2Fcontribution-counters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jahidulpabelislam%2Fcontribution-counters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jahidulpabelislam%2Fcontribution-counters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jahidulpabelislam","download_url":"https://codeload.github.com/jahidulpabelislam/contribution-counters/tar.gz/refs/heads/2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254304652,"owners_count":22048446,"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":["bitbucket-api","github-api","gitlab-api","nodejs","npm-package"],"created_at":"2024-11-19T11:18:27.745Z","updated_at":"2025-05-15T08:32:55.632Z","avatar_url":"https://github.com/jahidulpabelislam.png","language":"JavaScript","readme":"# Contribution Counters\n\n[![NPM](https://nodei.co/npm/contribution-counters.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://npmjs.org/package/contribution-counters)\n\n[![CodeFactor](https://www.codefactor.io/repository/github/jahidulpabelislam/contribution-counters/badge?style=flat-square)](https://www.codefactor.io/repository/github/jahidulpabelislam/contribution-counters)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/f0650e656bae4ca1ba9e9c2809b77991)](https://www.codacy.com/gh/jahidulpabelislam/contribution-counters/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=jahidulpabelislam/contribution-counters\u0026amp;utm_campaign=Badge_Grade)\n![npm](https://img.shields.io/npm/v/contribution-counters.svg)\n![npm](https://img.shields.io/npm/dm/contribution-counters.svg)\n![GitHub last commit (branch)](https://img.shields.io/github/last-commit/jahidulpabelislam/contribution-counters/2.x.svg?label=last%20activity)\n![npm bundle size](https://img.shields.io/bundlephobia/min/contribution-counters.svg)\n![NPM](https://img.shields.io/npm/l/contribution-counters.svg)\n\nHave you ever wanted to find out how many repos/projects you've contributed to and with how many commits?\nWell, now you can easily do so with this simple to use module!\n\nThis contribution counter is for 3 VCSs: GitHub, Bitbucket \u0026amp; GitLab and is achieved via each of their APIs and access tokens.\n\n## Instructions\n\n### Installing\n\n1.  To install locally: `npm install contribution-counters --save`\n2.  To install globally: `npm install contribution-counters --global`\n\n### Using module\n\n1.  Import the necessary counter like below:\n\n   `const { getGitHubCounts } = require(\"contribution-counters\");`\n\n2.  Set up the configuration for the selected counter\n\n   The config is an object with the following properties (all available on all counters unless specified):\n\n    -  `username`: Your username (string:required)\n    -  `accessToken`: An access token for the user above (string:required)\n    -  `minCommits`: The minimum number of commits a repo needs to count as a contribution (int:default=1)\n    -  `includeCommits`: Whether to include count of your commits (bool:default=true)\n    -  `includeProjects`: Whether to include count of repo/projects you've contributed to (bool:default=true)\n    -  `includePullRequests`: Whether to include count of pull/merge request contributions (bool:default=false)\n\n   The below two are only used if a commit doesn't have a real user attached (At least one is required for Bitbucket \u0026 GitLab \u0026 both optional for GitHub BUT advised to use both for all)\n\n    -  `userEmailAddresses`: Array of email addresses which may be associated with your commits (array)\n    -  `userNames`: Array of names which may be associated with your commits (array)\n\n   If you only want counts for after and/or before a particular date (inclusive) (or if you know the date you first and/or last contributed this can be used to minimise API requests)\n\n    -  `fromDate`: Datetime string (ISO-8601 Date/timestamp (YYYY-MM-DDTHH:mm:ss.sssZ))\n    -  `untilDate`: Datetime string (ISO-8601 Date/timestamp (YYYY-MM-DDTHH:mm:ss.sssZ))\n\n   To get repos of which you have a minimum access to\n\n    -  `minRepoAccessLevel`: Only for GitLab (int:default=30)\\[10, 20, 30, 40, 50] (see [here](https://docs.gitlab.com/ee/api/members.html))\n    -  `minRepoRole`: Only for Bitbucket (string:default=contributor)\\[admin, contributor, member, owner] (see [here](https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D))\n    -  `minRepoRole`: Only for GitHub (comma separated string:default=owner,collaborator,organization_member)\\[owner, collaborator, organization_member] (see [here](https://developer.github.com/v3/repos/#parameters))\n\n   If you have a self-hosted GitLab, you will need to use the `url` option\n\n    - `url`: The URL where your GitLab is located at (for example `https://gitlab.jahidulpabelislam.com/` or `https://jahidulpabelislam.com/gitlab/`)\n\n3.  Start the counter with the following:\n\n        ```javascript\n        const counts = await getGitHubCounts(config);\n        ```\n\n4.  The returned result (`counts`) is an object with one or more properties (based on what you've requested):\n\n      - `commits` total number of your commits\n      - `projects` total number of projects you've contributed to\n      - `pullRequests` total number of pull/merge requests you've authored\n\n`getGitHubCounts` in the above example can be replaced with `getBitbucketCounts` or `getGitLabCounts`.\n\n### Creating access tokens\n\n  - [GitHub](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line)\n  - [GitLab](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token)\n  - [Bitbucket](https://confluence.atlassian.com/bitbucketserver/personal-access-tokens-939515499.html)\n\n## Upgrading\n\n### v1 to v2\n\nIn version 2, the only breaking change is that only functions can be imported/required, instead of Counter classes.\n\nTo upgrade you will need to import/require the 3 new functions: `getBitbucketCounts`, `getGitHubCounts` \u0026amp; `getGitLabCounts` instead of `Bitbucket`, `GitHub` \u0026amp; `GitLab`.\nWhere before you created an instance of a class (e.g. `GitHub`) and passed in an object of config, then called a function (`getCounters`) to get the counts.\nNow the new functions will do both in one. So just call the new function and pass in the existing config object as the only parameter and then your counts will be returned.\n\n## Support\n\nIf you found this module interesting or useful please spread the word about this module: share on your socials, star on GitHub, etc.\n\nIf you find any issues or have any feature requests, you can open an [issue](https://github.com/jahidulpabelislam/contribution-counters/issues) or email [me @ jahidulpabelislam.com](mailto:me@jahidulpabelislam.com) :smirk:.\n\n## Authors\n\n  - [Jahidul Pabel Islam](https://jahidulpabelislam.com/) [\u003cme@jahidulpabelislam.com\u003e](mailto:me@jahidulpabelislam.com)\n\n## Licence\n\nThis module is licenced under the General Public Licence - see the [Licence](LICENSE.md) file for details\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjahidulpabelislam%2Fcontribution-counters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjahidulpabelislam%2Fcontribution-counters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjahidulpabelislam%2Fcontribution-counters/lists"}