node package manager


Latest GitHub Tag

Fetch the latest tag name from a GitHub repo (promise-based)

Build Status NPM version js-standard-style

latestTag('mhkeller', 'stable-tag').then(function (tag) {
  console.log(tag) // Outputs v1.0.0 
.catch(function (err) {

Resolves to an error if a package has no tags.


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's authenticate method.
  • timeout — A value, in milliseconds, to wait for this call to be made. Defaults to 5000.
latestTag('mhkeller', 'secret-repo', {
  timeout: 0,
  auth: {
    type: 'oauth', // See for other types 
    token: 'your-access-token'
}).then(function (tag) {
  console.log(tag) // Outputs the latest tag 
.catch(function (err) {