# cz-emoji

> Commitizen adapter formatting commit messages using emojis.

Latest version **1.3.2-canary.2** (published 2022-08-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install cz-emoji
pnpm add cz-emoji
yarn add cz-emoji
bun add cz-emoji
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.2-canary.2 |
| Published | 2022-08-02 |
| First published | 2016-12-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 10 |
| Unpacked size | 21.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 411 |
| Author | Nicolas Gryman |
| Maintainers | ngryman |
| Keywords | commitizen, adapter, emoji |

## Links

- npm: https://www.npmjs.com/package/cz-emoji
- Repository: https://github.com/ngryman/cz-emoji
- Homepage: https://github.com/ngryman/cz-emoji#readme
- Issues: https://github.com/ngryman/cz-emoji/issues
- npm.io page: https://npm.io/package/cz-emoji

## Dependencies (10)

- [pad](https://npm.io/package/pad.md) ^2.3.0
- [find-up](https://npm.io/package/find-up.md) ^5.0.0
- [fuse.js](https://npm.io/package/fuse.js.md) ^3.4.5
- [homedir](https://npm.io/package/homedir.md) ^0.6.0
- [prettier](https://npm.io/package/prettier.md) ^1.18.2
- [wrap-ansi](https://npm.io/package/wrap-ansi.md) ^7.0.0
- [read-pkg-up](https://npm.io/package/read-pkg-up.md) ^7.0.1
- [cli-truncate](https://npm.io/package/cli-truncate.md) ^1.0.0
- [inquirer-autocomplete-prompt](https://npm.io/package/inquirer-autocomplete-prompt.md) ^0.12.0
- [inquirer-maxlength-input-prompt](https://npm.io/package/inquirer-maxlength-input-prompt.md) ^1.0.1

## Recent versions

- 1.3.2-canary.2 (latest) — 2022-08-02
- 1.3.2-canary.1 (canary) — 2022-07-24
- 1.2.3-1 (next) — 2020-11-06
- 1.3.2-canary.0 — 2022-07-24
- 1.3.1 — 2020-11-10
- 1.3.0 — 2020-11-06
- 1.2.3-2 — 2020-11-06
- 1.2.3-0 — 2020-11-06
- 1.2.2 — 2020-08-12
- 1.2.1 — 2020-02-23
- 1.2.0 — 2020-01-19
- 1.2.0-1 — 2019-11-12
- 1.2.0-0 — 2019-11-03
- 1.1.2 — 2018-07-01
- 1.1.1 — 2018-05-11
- … 4 more at https://npm.io/package/cz-emoji/versions

## README

# cz-emoji

> Commitizen adapter formatting commit messages using emojis.

**cz-emoji** allows you to easily use emojis in your commits using [commitizen].

```sh
? Select the type of change you are committing: (Use arrow keys)
❯ feature   🌟  A new feature
  fix       🐞  A bug fix
  docs      📚  Documentation change
  refactor  🎨  A code refactoring change
  chore     🔩  A chore change
```

## Install

**Globally**

```bash
npm install --global cz-emoji

# set as default adapter for your projects
echo '{ "path": "cz-emoji" }' > ~/.czrc
```

**Locally**

```bash
npm install --save-dev cz-emoji
```

Add this to your `package.json`:

```json
"config": {
  "commitizen": {
    "path": "cz-emoji"
  }
}
```

## Usage

```sh
$ git cz
```

## Customization

By default `cz-emoji` comes ready to run out of the box. Uses may vary, so there are a few configuration options to allow fine tuning for project needs.

### How to

Configuring `cz-emoji` can be handled in the users home directory (`~/.czrc`) for changes to impact all projects or on a per project basis (`package.json`). Simply add the config property as shown below to the existing object in either of the locations with your settings for override.

```json
{
  "config": {
    "cz-emoji": {}
  }
}
```

### Configuration Options

#### Types

By default `cz-emoji` comes preconfigured with the [Gitmoji](https://gitmoji.carloscuesta.me/) types.

An [Inquirer.js] choices array:

```json
{
  "config": {
    "cz-emoji": {
      "types": [
        {
          "emoji": "🌟",
          "code": ":star2:",
          "description": "A new feature",
          "name": "feature"
        }
      ]
    }
  }
}
```

#### Scopes

An [Inquirer.js] choices array:

```json
{
  "config": {
    "cz-emoji": {
      "scopes": ["home", "accounts", "ci"]
    }
  }
}
```

#### Symbol

A boolean value that allows for an using a unicode value rather than the default of [Gitmoji](https://gitmoji.carloscuesta.me/) markup in a commit message. The default for symbol is false.

```json
{
  "config": {
    "cz-emoji": {
      "symbol": true
    }
  }
}
```

#### Skip Questions

An array of questions you want to skip:

```json
{
  "config": {
    "cz-emoji": {
      "skipQuestions": ["scope", "issues"]
    }
  }
}
```

You can skip the following questions: `scope`, `body`, `issues`, and `breaking`. The `type` and `subject` questions are mandatory.


#### Customize Questions

An object that contains overrides of the original questions:

```json
{
  "config": {
    "cz-emoji": {
      "questions": {
        "body": "This will be displayed instead of original text"
      }
    }
  }
}
```

#### Customize the subject max length

The maximum length you want your subject has

```json
{
  "config": {
    "cz-emoji": {
      "subjectMaxLength": 200,
    }
  }
}
```

## Examples

- https://github.com/Falieson/TRAM

## Commitlint

Commitlint can be set to work with this package by leveraging the package https://github.com/arvinxx/commitlint-config-gitmoji.

```bash
npm install --save-dev commitlint-config-gitmoji
```

_commitlint.config.js_

```js
module.exports = {
  extends: ['gitmoji'],
  parserPreset: {
    parserOpts: {
      headerPattern: /^(:\w*:)(?:\s)(?:\((.*?)\))?\s((?:.*(?=\())|.*)(?:\(#(\d*)\))?/,
      headerCorrespondence: ['type', 'scope', 'subject', 'ticket']
    }
  }
}
```

## Other projects

- [Fauda](https://github.com/ngryman/fauda): configuration made simple.
- [Commitizen Emoji](https://github.com/ngryman/cz-emoji): Commitizen adapter formatting commit messages using emojis.
- [Reading Time](https://github.com/ngryman/reading-time): Medium's like reading time estimation.

## License

MIT © [Nicolas Gryman](http://ngryman.sh)

[commitizen]: https://github.com/commitizen/cz-cli
[inquirer.js]: https://github.com/SBoudrias/Inquirer.js/

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