0.1.0-beta.0 • Published 2 years ago

@anchoredlabs/contrib v0.1.0-beta.0

Weekly downloads
1
License
Apache-2.0
Repository
-
Last release
2 years ago

Contrib

A CLI tools to generate a CONTRIBUTORS file based on git commits to highlight the work of the contributors to the project

Install

With npm:

# global (to use as a CLI tool)
npm install --global @anchoredlabs/contrib

# to use programmatically
npm install -D @anchoredlabs/contrib

With yarn:

# global (to use as a CLI tool)
yarn global add @anchoredlabs/contrib

# to use programmatically
yarn add --dev @anchoredlabs/contrib

Usage

# from the project directory with default options
contrib

# to generate the list of contributors for a different directory, use the `cwd` flag
contrib --cwd path/to/another/directory

API

contrib(options?)

Creates a CONTRIBUTORS.md file in the current working directory

options

Type: object You can specify the below options.

cwd

cwd Current working directory of the script Default: current working directory

Type: string\ Default: process.cwd()

Working directory to find .git directory.

contributors-file

Type: boolean\ Default: true

Whether or not the generated contributors are added to the contributors file (file will be created if it does not exist)

package-file

Type: boolean\ Default: false

Whether or not the generated contributors are added to the package.json file

sort, s

Type: string\ Default: lastName

Sorts the output by the specified property

sort-order

Type: string\ Choices: asc, desc\ Default: asc

The sorting direction

merge, -m

Type: array

A simple way to merge names or emails. NOTE: Git's .mailmap functionality can be used to perform more complex merging

contrib --merge "original:new value" --merge "second:another value"
# or you can simply list the values (space separated)
contrib --merge "original:new value" "second:another value"
include-domains

Type: array

Only allows emails with the specified domains. Value is used similar to a string.includes() so example would match me@example.com, but it would also match wrong@myexamplesite.com. To account for this, the value is passed in to new RegExp() which allows you to more precisely match emails. You can pass example.com$ to match only emails from me@example.com and not wrong@myexamplesite.com.

exclude-domains

Type: array

Omits emails with the specified domains. This value is processed in the same manner as --include-domains.

contributors-file-name

Type: string\ Default: CONTRIBUTORS.md

The file name for the contributors file.

contributors-file-message

Type: string\ Default: Thank you to all the Contributors that have helped support this project.

A message that is added to the top of the contributors file.

contributors-directory-path

Type: string\ Default: the value of the cwd options above.

The directory in which the contributors file should be created.

verbose, -v

Run with verbose logging, helpful when troubleshooting.

dry-run, --dry

Simulate the operation, with verbose logging

help

Show help

version

Show version number

License

Apache-2.0 © Anchored Labs

0.1.0-beta.0

2 years ago