node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »

latest-git-tag

latest-git-tag

get the latest git tag

install

$ npm install latest-git-tag

usage

cli

$ latest-git-tag
# vX.X.X 
 
$ latest-git-tag --strip
# X.X.X 

node

const latestTag = require('latest-git-tag');
 
latestTag().then(tag => {
  console.log(tag); // vX.X.X 
}
 
latestTag({ strip: true }).then(tag => {
  console.log(tag); // X.X.X 
}

api

latestGitTag([options])

Get the latest git tag. Pass options.

options

strip

Type: boolean

Default: false

Strip out the leading v from the tag.

always

Type: boolean

Default: false

Failsafe if no tag can be described

license

mit @ kasper lewau