Giter Site home page Giter Site logo

labeler's Introduction

Labeler

Labeler es una librería base para cualquier aplicación que requiera colocar etiquetas en github automáticamente.

npm i @lottielabs/labeler

Contribuir: CONTRIBUTING.md

Empezar

Labeler es una clase con algunos métodos.

constructor(options:labeler_options)
options:

  • repo: string
  • token: string

Crea la instancia de Labeler.

const labeler = new Labeler({
    repo: "owner/repo",
    token: "1a2b3c4d3e4f5g6h7i8j9k"
})

Obtener etiquetas

.get_label(label_name: string): Promise<label>
label_name: string
@returns: label*

Obtiene una label del repo a partir de su nombre.

const label = await labeler.get_label("bug")

.get_labels(labels_name: string[] | "*"): Promise<label[]>
labels_name: string[] o "*"
@returns: label[]*

Obtiene varias labels del repo usando sus nombres, o todas las labels si se pasa un asterisco como nombre.

const labels = await labeler.get_labels(["bug", "mylabel"])

Añadir etiquetas

.add_label(label: label): Promise<void>
label: label*

Añade una label al repositorio.

await labeler.add_label({
    name: "custom_label",
    color: "ff0000",
    description: "Mi label roja"
})

.add_labels(labels: label[]): Promise<void>
label: label[]*

Añade muchas labels al repo.

const labels = [
    {
        name: "label green",
        color: "00ff00",
        description: "mi label verde"
    },
    {
        name: "label green",
        color: "0000ff",
        description: "mi label azul"
    }
]

await labeler.add_labels(labels)

Eliminar etiquetas

.delete_label(label_name: string): Promise<void>
label_name: string

Elimina una label del repo a partir de su nombre.

await labeler.delete_label("label blue")

.delete_labels(labels_name: string[] | "*"): Promise<void>
lables_name: string[] o "*"

Elimina muchas labels según su nombre, o todas las labels si se pasa un asterisco como nombre.

await labeler.delete_labels("*")

label

type label = {
    name: string
    color: string
    description?: string
}

Todo

  • Documentar todo el código.
  • Escribir el contributing como debe ser.
  • Arreglar el manejo de errores horrible de la librería.

labeler's People

Contributors

enzodiazdev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.