# assert-valid-github-label-name

> Assert a given string is a valid Github issue label name

Latest version **1.0.0** (published 2017-01-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install assert-valid-github-label-name
pnpm add assert-valid-github-label-name
yarn add assert-valid-github-label-name
bun add assert-valid-github-label-name
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-01-17 |
| First published | 2017-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Shinnosuke Watanabe |
| Maintainers | shinnn |
| Keywords | github, label, issue, string, check, test, assert, assertion, throw, validate, validation, validity, if |

## Links

- npm: https://www.npmjs.com/package/assert-valid-github-label-name
- Repository: https://github.com/shinnn/assert-valid-github-label-name
- Homepage: https://github.com/shinnn/assert-valid-github-label-name#readme
- Issues: https://github.com/shinnn/assert-valid-github-label-name/issues
- npm.io page: https://npm.io/package/assert-valid-github-label-name

## Dependencies (2)

- [append-type](https://npm.io/package/append-type.md) ^1.0.0
- [validate-github-label-name](https://npm.io/package/validate-github-label-name.md) ^1.0.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-01-17
- 0.0.0 — 2017-01-17

## README

# assert-valid-github-label-name

[![NPM version](https://img.shields.io/npm/v/assert-valid-github-label-name.svg)](https://www.npmjs.com/package/assert-valid-github-label-name)
[![Bower version](https://img.shields.io/bower/v/assert-valid-github-label-name.svg)](https://github.com/shinnn/assert-valid-github-label-name/releases)
[![Build Status](https://travis-ci.org/shinnn/assert-valid-github-label-name.svg?branch=master)](https://travis-ci.org/shinnn/assert-valid-github-label-name)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/assert-valid-github-label-name.svg)](https://coveralls.io/r/shinnn/assert-valid-github-label-name)

Assert a given string is a valid [Github issue label](https://help.github.com/articles/creating-and-editing-labels-for-issues-and-pull-requests/) name

```javascript
import assertValidGithubLabelName from 'assert-valid-github-label-name';

assertValidGithubLabelName('label🍕name🍔\n');
```

```
/Users/shinnn/node_modules/assert-valid-github-label-name/index.js:27
  throw new Error(
  ^

Error: Expected a valid Github issue label name, but got an invalid name "label🍕name🍔\n":
at 5,10: Invalid characters: "🍕" and "🍔". Label name cannot have Unicode characters above 0xFFFF.
at 11: Label name cannot have linebreaks.
```

## Installation

### [npm](https://www.npmjs.com/)

```
npm install assert-valid-github-label-name
```

### [bower](https://bower.io/)

```
bower install assert-valid-github-label-name
```

## API

### assertValidGithubLabelName(*str*)

*str*: `String` (Github issue label name)  

It throws an error when the given string is not a valid Github issue label name.

```javascript
import assertValidGithubLabelName from 'assert-valid-github-label-name';

// doesn't throw
assertValidGithubLabelName('foo');
assertValidGithubLabelName('bar baz');

// throws an error
assertValidGithubLabelName('😄');
assertValidGithubLabelName('𠮷');
assertValidGithubLabelName('ab\ncd');
assertValidGithubLabelName(' ');
assertValidGithubLabelName('');
```

## License

Copyright (c) 2017 [Shinnosuke Watanabe](https://github.com/shinnn)

Licensed under [the MIT License](./LICENSE).

---
_Source: https://npm.io/package/assert-valid-github-label-name · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
