Skip to content

RichardLitt/gh-topics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gh-topics

Build Status standard-readme compliant

Set and get a GitHub repository topics

NOTE: GitHub's API does not yet adequately return the topics tag. As such, this code will not work, at all. See the note here.

If you think this is not true, ping me immediately by opening an issue. I will make this work.

Install

npm install --save gh-topics

or

npm install --global gh-topics

Usage

const ghTopics = require('gh-topics');

ghTopics('RichardLitt/gh-topics');
//=> 'Set and get a GitHub repository topics'
ghTopics('RichardLitt/gh-topics', 'unicorns & rainbows');
//=> 'unicorns & rainbows'

API

ghTopics(repoName, topics, [options], token)

repoName

Type: string

The name for the repository to test.

topics

Type: string

The new topics to set. To set, you must also supply the repoName first.

options

None.

token

Your GitHub access token, if not set as an env variable or supplied in the CLI.

CLI

The gh-topics command uses ghauth to generate and locally store a GitHub API personal token.

You can skip this step by manually generating a token and setting it as an environment variabled named GH_DESCRIPTION_TOKEN.

$ gh-topics --help

  Usage
    $ gh-topics

  Examples
    $ gh-topics
    Current topics: Set and get a GitHub repository topics
    $ gh-topics RichardLitt/gh-topics 'ponies and unicorns'
    New topics: ponies and unicorns

Contribute

PRs and issues gladly accepted!

License

MIT © Richard Littauer

About

Set and get a GitHub repository's topics

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published