Display Version on your websites using github releases / commits
$ npm install autoversion-git
const autoversion = require('autoversion-git');
let owner = 'getredash'
let repo = 'redash'
let shaOrBranch = 'master'
// Create version based on latest release
const version = autoversion.getReleaseVersion(owner, repo, shaOrBranch);
// Create version based on number of commits
let digits = 3
const version = autoversion.getCommitVersion(owner, repo, shaOrBranch, digits);
import {getCommitVersion, getReleaseVersion} from 'autoversion';
let owner = 'getredash'
let repo = 'redash'
let shaOrBranch = 'master'
// Create version based on latest release
const version = getReleaseVersion(owner, repo, shaOrBranch);
// Create version based on number of commits
let digits = 3
const version = getCommitVersion(owner, repo, shaOrBranch, digits);
Type: string
Owner of the github repository
Type: string
Repository Name
Type: string
Owner of the github repository
Type: string
Repository Name
Type: string
The option can take either sha - 6351cf255a30d166376737e831dea2cb4a1c39f9
or branch - master
Type: int
Default: 3
The number of digits to show ex: 1234 commits and digits=3 => returns 1.2.3