# @anchoredlabs/contrib

> Generate list of contributors from a git repo

Latest version **0.1.0-beta.0** (published 2020-02-17) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @anchoredlabs/contrib
pnpm add @anchoredlabs/contrib
yarn add @anchoredlabs/contrib
bun add @anchoredlabs/contrib
```

Provides the command `contrib`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0-beta.0 |
| Published | 2020-02-17 |
| First published | 2020-02-17 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 20.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ryan Crosser |
| Maintainers | ryancrosser |

## Links

- npm: https://www.npmjs.com/package/@anchoredlabs/contrib
- npm.io page: https://npm.io/package/@anchoredlabs/contrib

## Dependencies (3)

- [yargs](https://npm.io/package/yargs.md) ^15.1.0
- [detect-indent](https://npm.io/package/detect-indent.md) ^6.0.0
- [sort-package-json](https://npm.io/package/sort-package-json.md) ^1.39.1

## Recent versions

- 0.1.0-beta.0 (latest) — 2020-02-17

## README

# 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

```sh
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

---
_Source: https://npm.io/package/@anchoredlabs/contrib · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
