Code Monkey home page Code Monkey logo

contributors's Introduction

@mocha/contributors

Add & update list of Git contributors in package.json

MOCHA NO LONGER USES THIS PACKAGE AND IT WILL SEE NO FURTHER DEVELOPMENT

This module uses git to find all committers to a repo; it respects .mailmap, if present.

Table of Contents

Install

$ npm i @mocha/contributors -D

Usage

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"
  }
}

API

@mocha/contributors

Provides functions to get contributors from commit history, process and write those contributors to package.json.

@mocha/contributors.getContributors([opts]) ⇒ Array.<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 <[email protected]>'],
  '/path/to/working/copy/',
  'en-US',
  {sensitivity: 'accent'}
); // returns Array of contributors

@mocha/contributors.updateContributors([opts]) ⇒ string

Given 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

Maintainers

@boneskull

Contribute

PRs accepted.

Small note: If editing the README, please conform to the standard-readme specification.

License

Apache-2.0 © 2019 JS Foundation & Contributors

contributors's People

Contributors

boneskull avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.