{"id":13583553,"url":"https://github.com/mgechev/github-contributors-list","last_synced_at":"2025-04-06T09:11:24.512Z","repository":{"id":14715094,"uuid":"17435561","full_name":"mgechev/github-contributors-list","owner":"mgechev","description":"Node.js script, which outputs all the contributors for given open GitHub project","archived":false,"fork":false,"pushed_at":"2023-01-06T19:02:26.000Z","size":510,"stargazers_count":135,"open_issues_count":5,"forks_count":46,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-30T07:11:55.756Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/mgechev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-05T09:50:27.000Z","updated_at":"2025-03-22T01:07:12.000Z","dependencies_parsed_at":"2023-01-11T20:22:26.598Z","dependency_job_id":null,"html_url":"https://github.com/mgechev/github-contributors-list","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgechev%2Fgithub-contributors-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgechev%2Fgithub-contributors-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgechev%2Fgithub-contributors-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgechev%2Fgithub-contributors-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgechev","download_url":"https://codeload.github.com/mgechev/github-contributors-list/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247457803,"owners_count":20941906,"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":[],"created_at":"2024-08-01T15:03:35.028Z","updated_at":"2025-04-06T09:11:24.493Z","avatar_url":"https://github.com/mgechev.png","language":"JavaScript","readme":"## Contributors list\n\nBuild awesome list of the contributors of your project! You can even filter your contributors to list only those individuals who committed after a specific date or who committed to a specific branch or SHA.\n\n![Demo](https://raw.githubusercontent.com/mgechev/github-contributors-list/master/assets/demo.png)\n\n## Usage\n\nIn order to get the contributors list for your open-source project use:\n\n```bash\ngithubcontrib --owner USERNAME --repo REPO_NAME --cols 6 --filter user1,user2,user3 | pbcopy\n```\n\n### Advanced API\n\n| **Parameter name** | **Description**                                                   | **Default value**                      | **Sample value**                    |\n|--------------------|-------------------------------------------------------------------|----------------------------------------|-------------------------------------|\n| `repo`             | Repository name. ]                                                                      | (required)                                   | `--repo angular-material`              |\n| `owner`             | Repository owner that the repo belongs to.                                                          | (required)                                  | `--owner angular`                    |\n| `fromDate`   | YYYY-MM-DD used to determine only the contributors after the specified commit fromDate.                                                          | `''`  | `--fromDate 2016-04-01` |\n| `sha`   | SHA or branch name to start listing commits from. Default == the repository’s default branch (usually master).                                                          | `''`  | `--sha e58f3629e` |\n| `sortOrder`        | Specifies the sort order.                                                               | `'asc'`                                | `--sortOrder desc`                  |\n| `sortBy`           | Specifies the sort property. It will be passed as third argument to the `sortStrategy`. | `'contributions'`                      | `--sortBy login`                    |\n| `sortStrategy`     | Custom sort strategy. Built-in strategies support string and number comparison.         | `'../lib/sort_strategies/sort_asc.js'` | `--sortStrategy custom_sort.js`     |\n| `layoutStrategy`   | Specifies how the output will be formatted.                                             | `'../lib/layout_strategies/table.js'`  | `--layoutStrategy custom_layout.js` |\n| `filter`           | Specifies users to be filtered.                                                         | `[]`                                   | `--filter userlogin1,userlogin2`    |\n| `filterStrategy`   | Specifies the filter strategy.                                                          | `'../lib/filter_strategies/login.js'`  | `--filterStrategy custom_filter.js` |\n| `authToken`   | Specifies the scope-limited Github oAuth application token: required increase your request rate limit to 5000 / hour.                                                          | `''`  | `--authToken 0da9a3f98dff9a61a0222fd5db201221c5b129f8` |\n\nThis way your contributors will be formatted in a table with their photos.\n\nThe table strategy accepts the following parameters:\n\n- `image-size` - Number - size of the user's avatars\n- `format` - Enum - `MARKDOWN` or `HTML`. Default == `HTML`\n- `showlogin` - Boolean, indicates whether the login of the contributor should be shown in the table. Default == `false`\n- `columns-count` - Number - number of columns for the table\n\n## Different ways of formatting\n\nYou can easily add more formatting strategies by exporting the formatting logic.\n\nHere's a sample implementation of a list layout strategy:\n\n```js\nvar formatter = function (options) {\n  options = options || {};\n  var field = options.field || 'login',\n      numbered = options.style === 'numbers';\n\n  return function (data) {\n    var result = '\\n';\n    data.forEach(function (user, idx) {\n      if (numbered) {\n        result += idx + 1;\n      } else {\n        result += '-';\n      }\n      result += ' ' + user[field] + '\\n';\n    });\n    return result;\n  };\n};\n\nmodule.exports = formatter;\n```\n\n## Testing with Curl\n\nYou can easily use the command line to query for a single page of information from the Github API.\n\n* Get List of commits for the repository since 4/1/2016:\n```console\ncurl -i -H \"Accept: application/json\" -H \"Content-Type: application/json\" -H \"Authorization: token \u003caccessToken\u003e\"  -X GET -d '{\"since\":\"2016-04-01T00:00:00\"}' https://api.github.com/repos/\u003cowner\u003e/\u003crepository\u003e/commits  \u003e commits.json\n```\n\n* Get list of contributors for the repository:\n```console\ncurl -i -H \"Accept: application/json\" -H \"Content-Type: application/json\" -H \"Authorization: token \u003caccessToken\u003e\" -X GET https://api.github.com/repos/\u003cowner\u003e/\u003crepository\u003e/contributors  \u003e contributors.json\n```\n\n\u003cbr/\u003e\n\nIf, however, you want all the data and the full power... use `githubcontrib` to get a list of contributors, supports 1..n pages of data, and will format the JSON as Markdown or HTML tables\n\n```console\nnode githubcontrib --owner angular --repository material --sha master --since 2016-04-01 --cols 6 --sortOrder desc --format md --showlogin true  \u003e ../contributions.md\n```\n\n## Bash Function\n\nThe following bash function is quite convenient:\n\n```bash\nfunction ghcontrib() {\n  repo=$(basename $(pwd))\n  githubcontrib --owner USER_NAME --repo $repo --cols 6 --showlogin true --filter gitter-badger --sortOrder desc | pbcopy\n}\n```\n\nYou can invoke it with:\n\n```bash\nghcontrib\n```\n\nIt assumes that you're in the project's directory, the directory is named after your project on GitHub and your username is `USER_NAME`.\n\nThe function will run `githubcontrib` and put the returned markdown in your clipboard.\n\n## GitHub Limit\n\nThe Github API has a 60-requests-per-hour rate-limit for non-authenticated use. If you need some more then a scope-limited Github OAuth token can be used to boost the limit to 5000.\n\n## License\n\nMIT\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgechev%2Fgithub-contributors-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgechev%2Fgithub-contributors-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgechev%2Fgithub-contributors-list/lists"}