npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

github-label-manager

v1.1.1

Published

Import/Export Labels between two github projects

Downloads

5

Readme

Toolbox for Manage your Labels on Github projects You have to have an account who have enough rights for that kind of process

Why this package

One day with a teammate, we have many repositories and one of them only have been set with labels we use everyday. So we have to copy all of them in each repository. So we go on github labels interface and suprise ! You have to create your labels one by one...

This project was born. Some other packages allow you to do such things.

I just want to group them here and maybe add some more.

Install

$ npm install github-label-manager --g

Settings

This command have need your Github username and a generate token provided by Github

Generate a new token

Create a Personal access token on GitHub is really easy. Go to this page and create a new token with the repo and public_repo permissions enabled.

Authentication via environment variable

Then add the following environment variables in your .bashrc (Linux) or .bash_profile (Mac).

export GITHUB_USER = "youtGithubUsername"
export GITHUB_TOKEN = "yourfreshlygeneratedToken"

Authentication via command options

You can authenticate via options if you prefer, this will override environment variables in case of you set it.

$ #Use clear command with command authentication
$ glm -u <yourGithubUsername> -t <yourfreshlygeneratedToken> <command> 
$ glm -u minion -t grusupertokenforminion clear evil-project-from-gru 

Usage

Copy

This command allow you to copy all your labels from the origin repository to the destination repository. If a label already exist this command dosen't override it.

#Copy labels from origin to destination
glm copy <origin-repo-name> <destination-repo-name>

Clear

This command will clear all labels in targeted repository

#Clear all labels from origin
glm clear <origin-repo-name>

Import

This command allow you to import a JSON file which contains your labels for the targeted repository. This JSON file have to contains your labels which need to follow this pattern

[{
  "name": "Error",
  "color": "FF0000"
},
{
  "name": "Done",
  "color": "15BD0A"
},
{
  "name": "...",
  "color: "..." 
}]

And finally the example of this command usage

#Import labels from JSON file to repository
glm import <repo-name> <path-to-json-file>

Export

The opposite of import command, this will export all your labels for a repository in a JSON file following the import JSON pattern

#Export labels from repository to json file  
glm export <repo-name> <path-to-json-file>

Note

You can specify which organisation to use on by prefixing the repository with org (Example : superorg:myawesomerepo)

#Copy labels from origin to destination (we precise organisation to target good repository)
glm copy gru-tech:evil-machina minion-factory:evil-machina

Misc

You can use help if you need it

#Detail about all available commands
glm --help

Todo

  • Can import only label and randomly create a color for it
  • Make some other cool thing :D

License

MIT © Vidal Julien