
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
@mocha/contributors
Advanced tools
Add & update list of Git contributors in
package.json
This module uses git to find all committers to a repo; it respects .mailmap, if present.
$ npm i @mocha/contributors -D
contributors [options]
Options:
--help Show help [boolean]
--version Show version number [boolean]
--exclude, -x Exclude author/email from list (repeatable)
[array] [default: (author prop of package.json)]
--package, -p, --pkg Path of package.json to update
[string] [default: (closest package.json)]
--property Name of property to update
[string] [default: "contributors"]
Configuration can be specified using the @mocha/contributors property of your package.json, e.g.:
{
"@mocha/contributors": {
"exclude": ["some", "people"],
"package": "/path/to/package.json",
"property": "contributors"
}
}
Provides functions to get contributors from commit history, process and write those contributors to package.json.
Array.<string>stringArray.<string>Get 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.
Kind: static method of @mocha/contributors
Returns: Array.<string> - Sorted list of contributors
Access: public
See
| Param | Type | Default | Description |
|---|---|---|---|
| [opts] | Object | {} | Options |
| [opts.exclude] | Array.<string> | Set.<string> | [] | A list of authors/emails to ignore; must be exact match |
| [opts.cwd] | string | Working copy dir; defaults to process.cwd() | |
| [opts.locale] | string | Array.<string> | "en-US" | Locale(s) to pass to String.prototype.localeCompare |
| [opts.localeOpts] | Object | {sensitivity: 'accent'} | Options for String.prototype.localeCompare |
Example
// get list of contributors for your package (without Guy Fieri)
const {getContributors} = require('@mocha/contributors');
getContributors(
['Guy Fieri <guy@flavortown.com>'],
'/path/to/working/copy/',
'en-US',
{sensitivity: 'accent'}
); // returns Array of contributors
stringGiven a path to a package.json pkg, update Git contributors in the property defined by property, excluding those in the exclude array.
Kind: static method of @mocha/contributors
Returns: string - Resulting package.json
Access: public
| Param | Type | Default | Description |
|---|---|---|---|
| [opts] | Object | Options | |
| [opts.pkg] | string | Path to package.json; searches for closest by default | |
| [opts.exclude] | Array.<string> | Set.<string> | A list of authors/emails to ignore; defaults to author prop of found package.json | |
| [opts.property] | string | "contributors" | Property name to update |
PRs accepted.
Small note: If editing the README, please conform to the standard-readme specification.
Apache-2.0 © 2018 JS Foundation & Contributors
FAQs
Add & update list of Git contributors in package.json
The npm package @mocha/contributors receives a total of 46 weekly downloads. As such, @mocha/contributors popularity was classified as not popular.
We found that @mocha/contributors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.