# git-label

> Automates and simplifies the creation of labels for GitHub repositories

Latest version **4.1.1** (published 2016-01-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install git-label
pnpm add git-label
yarn add git-label
bun add git-label
```

## 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 | 4.1.1 |
| Published | 2016-01-08 |
| First published | 2015-12-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4.0.0 |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 79 |
| Author | Jason Bellamy |
| Maintainers | jasonbellamy |
| Keywords | labels, github, git, utils |

## Links

- npm: https://www.npmjs.com/package/git-label
- Repository: https://github.com/jasonbellamy/git-label
- Homepage: https://github.com/jasonbellamy
- Issues: https://github.com/jasonbellamy/git-label/issues
- npm.io page: https://npm.io/package/git-label

## Dependencies (3)

- [glob](https://npm.io/package/glob.md) ^6.0.3
- [lineder](https://npm.io/package/lineder.md) ^0.1.1
- [request](https://npm.io/package/request.md) ^2.67.0

## Recent versions

- 4.1.1 (latest) — 2016-01-08
- 4.1.0 — 2016-01-08
- 4.0.0 — 2016-01-08
- 3.4.0 — 2016-01-05
- 3.3.0 — 2016-01-02
- 3.2.0 — 2016-01-02
- 3.1.3 — 2016-01-01
- 3.1.2 — 2016-01-01
- 3.1.1 — 2016-01-01
- 3.1.0 — 2016-01-01
- 3.0.1 — 2015-12-31
- 2.0.2 — 2015-12-31
- 3.0.0 — 2015-12-31
- 2.0.1 — 2015-12-31
- 2.0.0 — 2015-12-31
- … 1 more at https://npm.io/package/git-label/versions

## README

# git-label [![Build Status](https://travis-ci.org/jasonbellamy/git-label.svg)](https://travis-ci.org/jasonbellamy/git-label)

> Automates and simplifies the creation of labels for GitHub repositories


## Getting Started

- Install with [NPM](https://www.npmjs.org/) - `npm install --save git-label`


## Usage

```javascript
var gitLabel = require('git-label');

var config = {
  api   : 'https://api.github.com',
  repo  : 'username/repo',
  token : 'yoursupersecretapitoken'
};

var labels = [
  { "name": "bug", "color": "#fc2929" },
  { "name": "duplicate", "color": "#cccccc" }
];

// remove specified labels from a repo
gitLabel.remove(config, labels)
  .then(console.log)  //=> success message
  .catch(console.log) //=> error message

// add specified labels to a repo
gitLabel.add(config, labels)
  .then(console.log)  //=> success message
  .catch(console.log) //=> error message
```


#API

### add( config, labels )

Name         | Type     | Argument     | Default | Description
-------------|----------|--------------|---------|------------
config       | `object` | `<required>` | `null`  | the server configuration object
config.api   | `string` | `<required>` | `null`  | the api endpoint to connect to
config.token | `string` | `<required>` | `null`  | the api token to use
config.repo  | `string` | `<required>` | `null`  | the git repo to add labels to
labels       | `array`  | `<required>` | `null`  | the array of label objects

### remove( config, labels )

Name         | Type     | Argument     | Default | Description
-------------|----------|--------------|---------|------------
config       | `object` | `<required>` | `null`  | the server configuration object
config.api   | `string` | `<required>` | `null`  | the api endpoint to connect to
config.token | `string` | `<required>` | `null`  | the api token to use
config.repo  | `string` | `<required>` | `null`  | the git repo to add labels to
labels       | `array`  | `<required>` | `null`  | the array of label objects

### find( pattern )

Name         | Type     | Argument     | Default | Description
-------------|----------|--------------|---------|------------
pattern      | `string` | `<required>` | `null`  | the [globbing](https://github.com/isaacs/node-glob) pattern to the label packages


## Developing

[git-label](https://github.com/jasonbellamy/git-label) is built using **ES6**. Run the following task to compile the `src/` into `dist/`.

```bash
npm run build
```


## Related

- [git-label-cli](https://github.com/jasonbellamy/git-label-cli) - CLI for this module
- [git-label-packages](https://github.com/jasonbellamy/git-label-packages) - Default label packages for this module


## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.


## License
Copyright (c) 2016 [Jason Bellamy ](http://jasonbellamy.com)  
Licensed under the MIT license.

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