https://github.com/jasonbellamy/git-label
Automate and simplify the creation of labels for your GitHub repositories
https://github.com/jasonbellamy/git-label
Last synced: 3 months ago
JSON representation
Automate and simplify the creation of labels for your GitHub repositories
- Host: GitHub
- URL: https://github.com/jasonbellamy/git-label
- Owner: jasonbellamy
- License: mit
- Created: 2015-12-30T19:58:11.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-11-23T17:40:15.000Z (about 3 years ago)
- Last Synced: 2024-10-14T11:08:40.432Z (4 months ago)
- Language: JavaScript
- Size: 70.3 KB
- Stars: 75
- Watchers: 3
- Forks: 16
- Open Issues: 7
-
Metadata Files:
- Readme: readme.md
- Contributing: contributing.md
- License: license
Awesome Lists containing this project
- jimsghstars - jasonbellamy/git-label - Automate and simplify the creation of labels for your GitHub repositories (JavaScript)
README
# git-label [](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` | `` | `null` | the server configuration object
config.api | `string` | `` | `null` | the api endpoint to connect to
config.token | `string` | `` | `null` | the api token to use
config.repo | `string` | `` | `null` | the git repo to add labels to
labels | `array` | `` | `null` | the array of label objects### remove( config, labels )
Name | Type | Argument | Default | Description
-------------|----------|--------------|---------|------------
config | `object` | `` | `null` | the server configuration object
config.api | `string` | `` | `null` | the api endpoint to connect to
config.token | `string` | `` | `null` | the api token to use
config.repo | `string` | `` | `null` | the git repo to add labels to
labels | `array` | `` | `null` | the array of label objects### find( pattern )
Name | Type | Argument | Default | Description
-------------|----------|--------------|---------|------------
pattern | `string` | `` | `null` | the [globbing](https://github.com/isaacs/node-glob) pattern to the [label packages](https://github.com/jasonbellamy/git-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.