gh-description

0.1.15 • Public • Published

gh-description

Build Status standard-readme compliant

Set and get a GitHub repository description

Install

npm install --save gh-description

or

npm install --global gh-description

Usage

const ghDescription = require('gh-description');
 
ghDescription('RichardLitt/gh-description');
//=> 'Set and get a GitHub repository description'
ghDescription('RichardLitt/gh-description', 'unicorns & rainbows');
//=> 'unicorns & rainbows'

API

ghDescription(repoName, description, [options], token)

repoName

Type: string

The name for the repository to test.

description

Type: string

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

options

enterprise

Type: bool or string

Specify a different endpoint for the GitHub URL. Useful for GitHub Enterprise. Setting this flag as a boolean will automatically pull from the environmental variable GITHUB_ENDPOINT.

If using enterprise, the token must be explicitly set and cannot be passed through from the environment. This is to ensure that bad credentials from the public GitHub don't mess up the works.

Alias: e

token

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

CLI

The gh-description 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 variable named GH_DESCRIPTION_TOKEN.

$ gh-description --help

  Usage
    $ gh-description [input]

  Options
    -e, --enterprise  Specify a different GitHub endpoint

  Examples
    $ gh-description
    Set and get a GitHub repository description
    $ gh-description RichardLitt/gh-description
    Set and get a GitHub repository description
    $ gh-description RichardLitt/gh-description 'ponies and unicorns'
    New description: ponies and unicorns
    $ gh-description RichardLitt/gh-description -e
    New enterprise description: Engage
    $ gh-description RichardLitt/gh-description -e https://scottymcscottface.co.uk
    New enterprise description: Beam Me Up

Contribute

PRs and issues gladly accepted!

License

MIT © Richard Littauer

Package Sidebar

Install

npm i gh-description

Weekly Downloads

4

Version

0.1.15

License

MIT

Last publish

Collaborators

  • richardlitt