Interact with the GitHub releases API
npm install ghreleases> Interact with the GitHub releases API.

!node




List all releases for a repo. Calls back with an array of releases.
``js`
const gh = require('ghreleases')
const auth = {
token: '90230948aef88723eca2309880fea09789234',
user: 'ralphtheninja'
}
gh.list(auth, 'level', 'leveldown', (err, list) => {
console.log(list)
})
GitHub docs.
Get latest release.
`js`
gh.getLatest(auth, 'level', 'leveldown', (err, release) => {
console.log(release)
})
GitHub docs.
Get data for a single release.
`js`
gh.getById(auth, 'level', 'leveldown', '1363866', (err, release) => {
console.log(release)
})
GitHub docs.
Get release by tag.
`js`
gh.getByTag(auth, 'level', 'leveldown', 'v1.2.2', (err, release) => {
console.log(release)
})
GitHub docs.
Create a release.
`js`
const data = {
tag_name: '1.2.3-test',
name: 'Release name for 1.2.3-test',
body: 'Body text of release goes here'
}
gh.create(auth, 'level', 'leveldown', data, (err, release) => {
console.log(release)
})
The release on GitHub would then look as follows:
GitHub docs
Upload assets to a release. Calls back with an array of results for each upload request.
* The release parameter accepts either a release id, 'latest' or a valid ref, e.g. 'tags/v1.0.0'files
* The parameter is an array of absolute file paths that should be uploaded and associated with this release
`js`
const ref = 'tags/v1.3.0'
const files = [
'/path/to/README.md',
'/path/to/prebuilt/binary.tar.gz'
]
gh.uploadAssets(auth, 'level', 'leveldown', ref, files, (err, res) => {
console.log(res)
})
GitHub docs
For interacting with other parts of the GitHub API, check out the modules below.
* ghissues
* ghusers
* ghteams
* ghrepos
* ghpulls
* ghauth
* ghutils`
MIT