1.3.1 • Published 4 years ago
@rqt/github v1.3.1
@rqt/github
@rqt/github
is a GitHub API implementation in Node.JS.
yarn add @rqt/github
📙 Read all API documentation in Wiki
Table Of Contents
API
The package is available by importing its default function:
import GitHub from '@rqt/github'
constructor( token?: string,
): GitHub
Create a new instance of a GitHub API client. If the token is given, it will be used for methods that require it.
/* yarn example/ */
import GitHub from '@rqt/github'
import bosom from 'bosom'
(async () => {
try {
const token = await bosom('.token.json')
const name = 'github-example'
const org = 'rqt'
const github = new GitHub(token)
const repo = await github.repos.create({
name,
org,
homepage: 'https://rqt.biz',
license_template: 'mit',
description: 'An example repository.',
auto_init: true,
gitignore_template: 'Node',
})
console.log('Created a repository at: %s', repo.html_url)
await github.activity.star(org, name)
console.log('Starred a repository')
await github.repos.delete(org, name)
console.log('Deleted a repository')
} catch ({ message }) {
console.log(message)
}
})()
Created a repository at: https://github.com/rqt/github-example
Starred a repository
Deleted a repository
Copyright
Documentation descriptions by GitHub.