{"id":15170459,"url":"https://github.com/mochajs/contributors","last_synced_at":"2025-10-01T05:30:42.665Z","repository":{"id":56242129,"uuid":"160892935","full_name":"mochajs/contributors","owner":"mochajs","description":"Add \u0026 update list of Git contributors in package.json","archived":true,"fork":false,"pushed_at":"2020-11-18T23:34:26.000Z","size":713,"stargazers_count":5,"open_issues_count":9,"forks_count":4,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-01-17T07:35:50.302Z","etag":null,"topics":["author","collaborators","committers","contributors","git","npm","package-json"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mochajs.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":"2018-12-08T01:33:04.000Z","updated_at":"2024-09-11T03:27:42.000Z","dependencies_parsed_at":"2022-08-15T15:20:24.334Z","dependency_job_id":null,"html_url":"https://github.com/mochajs/contributors","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochajs%2Fcontributors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochajs%2Fcontributors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochajs%2Fcontributors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mochajs%2Fcontributors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mochajs","download_url":"https://codeload.github.com/mochajs/contributors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234827057,"owners_count":18892884,"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":["author","collaborators","committers","contributors","git","npm","package-json"],"created_at":"2024-09-27T08:02:58.587Z","updated_at":"2025-10-01T05:30:37.353Z","avatar_url":"https://github.com/mochajs.png","language":"JavaScript","readme":"# @mocha/contributors\n\n\u003e Add \u0026 update list of Git contributors in `package.json`\n\n**MOCHA NO LONGER USES THIS PACKAGE AND IT WILL SEE NO FURTHER DEVELOPMENT**\n\nThis module uses `git` to find all committers to a repo; it respects [`.mailmap`](https://www.git-scm.com/docs/git-check-mailmap#_mapping_authors), if present.\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n- [Maintainers](#maintainers)\n- [Contribute](#contribute)\n- [License](#license)\n\n## Install\n\n```shell\n$ npm i @mocha/contributors -D\n```\n\n## Usage\n\n```plain\ncontributors [options]\n\nOptions:\n  --help                Show help                                      [boolean]\n  --version             Show version number                            [boolean]\n  --exclude, -x         Exclude author/email from list (repeatable)\n                                [array] [default: (author prop of package.json)]\n  --package, -p, --pkg  Path of package.json to update\n                                      [string] [default: (closest package.json)]\n  --property            Name of property to update\n                                              [string] [default: \"contributors\"]\n```\n\nConfiguration can be specified using the `@mocha/contributors` property of your `package.json`, e.g.:\n\n```json\n{\n  \"@mocha/contributors\": {\n    \"exclude\": [\"some\", \"people\"],\n    \"package\": \"/path/to/package.json\",\n    \"property\": \"contributors\"\n  }\n}\n```\n\n## API\n\n\u003c!-- AUTO-GENERATED-CONTENT:START (JSDOC:files=src/index.js\u0026heading-depth=3\u0026module-index-format=none\u0026global-index-format=none) --\u003e\n\u003ca name=\"module_@mocha/contributors\"\u003e\u003c/a\u003e\n\n### @mocha/contributors\nProvides functions to get contributors from commit history, process and write those contributors to `package.json`.\n\n\n* [@mocha/contributors](#module_@mocha/contributors)\n    * [.getContributors([opts])](#module_@mocha/contributors.getContributors) ⇒ \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e\n    * [.updateContributors([opts])](#module_@mocha/contributors.updateContributors) ⇒ \u003ccode\u003estring\u003c/code\u003e\n\n\u003ca name=\"module_@mocha/contributors.getContributors\"\u003e\u003c/a\u003e\n\n#### @mocha/contributors.getContributors([opts]) ⇒ \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e\nGet list of contributors to Git repo at path `cwd`, excluding names/emails defined in `exclude`.  `locale` and `localeOpts` must be consistent between calls in order to avoid too much churn in the contributors list.\n\n**Kind**: static method of [\u003ccode\u003e@mocha/contributors\u003c/code\u003e](#module_@mocha/contributors)\n**Returns**: \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e - Sorted list of contributors\n**Access**: public\n**See**\n\n- https://git-scm.com/docs/git-log\n- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare\n\n\n| Param | Type | Default | Description |\n| --- | --- | --- | --- |\n| [opts] | \u003ccode\u003eObject\u003c/code\u003e | \u003ccode\u003e{}\u003c/code\u003e | Options |\n| [opts.exclude] | \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e \\| \u003ccode\u003eSet.\u0026lt;string\u0026gt;\u003c/code\u003e | \u003ccode\u003e[]\u003c/code\u003e | A list of authors/emails to ignore; must be exact match |\n| [opts.cwd] | \u003ccode\u003estring\u003c/code\u003e |  | Working copy dir; defaults to `process.cwd()` |\n| [opts.locale] | \u003ccode\u003estring\u003c/code\u003e \\| \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e | \u003ccode\u003e\u0026quot;en-US\u0026quot;\u003c/code\u003e | Locale(s) to pass to `String.prototype.localeCompare` |\n| [opts.localeOpts] | \u003ccode\u003eObject\u003c/code\u003e | \u003ccode\u003e{sensitivity: \u0026#x27;accent\u0026#x27;}\u003c/code\u003e | Options for `String.prototype.localeCompare` |\n\n**Example**\n```js\n// get list of contributors for your package (without Guy Fieri)\nconst {getContributors} = require('@mocha/contributors');\ngetContributors(\n  ['Guy Fieri \u003cguy@flavortown.com\u003e'],\n  '/path/to/working/copy/',\n  'en-US',\n  {sensitivity: 'accent'}\n); // returns Array of contributors\n```\n\u003ca name=\"module_@mocha/contributors.updateContributors\"\u003e\u003c/a\u003e\n\n#### @mocha/contributors.updateContributors([opts]) ⇒ \u003ccode\u003estring\u003c/code\u003e\nGiven a path to a package.json `pkg`, update Git contributors in the property defined by `property`, excluding those in the `exclude` array.\n\n**Kind**: static method of [\u003ccode\u003e@mocha/contributors\u003c/code\u003e](#module_@mocha/contributors)\n**Returns**: \u003ccode\u003estring\u003c/code\u003e - Resulting `package.json`\n**Access**: public\n\n| Param | Type | Default | Description |\n| --- | --- | --- | --- |\n| [opts] | \u003ccode\u003eObject\u003c/code\u003e |  | Options |\n| [opts.pkg] | \u003ccode\u003estring\u003c/code\u003e |  | Path to `package.json`; searches for closest by default |\n| [opts.exclude] | \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e \\| \u003ccode\u003eSet.\u0026lt;string\u0026gt;\u003c/code\u003e |  | A list of authors/emails to ignore; defaults to `author` prop of found `package.json` |\n| [opts.property] | \u003ccode\u003estring\u003c/code\u003e | \u003ccode\u003e\u0026quot;contributors\u0026quot;\u003c/code\u003e | Property name to update |\n\n\n\u003c!-- AUTO-GENERATED-CONTENT:END --\u003e\n\n## Maintainers\n\n[@boneskull](https://github.com/boneskull)\n\n## Contribute\n\nPRs accepted.\n\nSmall note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\n\nApache-2.0 © 2019 JS Foundation \u0026 Contributors\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmochajs%2Fcontributors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmochajs%2Fcontributors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmochajs%2Fcontributors/lists"}