latest-github-tag
v1.0.0
Published
Fetch the latest tag name from a GitHub repo (promise-based)
Downloads
3
Maintainers
Readme
Latest GitHub Tag
Fetch the latest tag name from a GitHub repo (promise-based)
latestTag('mhkeller', 'stable-tag').then(function (tag) {
console.log(tag) // Outputs v1.0.0
})
.catch(function (err) {
console.error(err)
})
Resolves to an error if a package has no tags.
Options
You can pass an options object as an optional third argument. It can take the two keys:
auth
— An authentication object that will be passed to the GitHub module'sauthenticate
method.timeout
— A value, in milliseconds, to wait for this call to be made. Defaults to5000
.
latestTag('mhkeller', 'secret-repo', {
timeout: 0,
auth: {
type: 'oauth', // See https://github.com/mikedeboer/node-github#authentication for other types
token: 'your-access-token'
}
}).then(function (tag) {
console.log(tag) // Outputs the latest tag
})
.catch(function (err) {
console.error(err)
})
License
MIT