Display version on websites using github release / commits
npm install autoversion-git> Display Version on your websites using github releases / commits
```
$ npm install autoversion-git
`js
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);
`
`js
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);
`
#### owner
Type: string
Owner of the github repository
#### repo
Type: string
Repository Name
#### owner
Type: string
Owner of the github repository
#### repo
Type: string
Repository Name
#### shaOrBranch
Type: string
The option can take either sha - 6351cf255a30d166376737e831dea2cb4a1c39f9 or branch - master
#### digits
Type: int3`
Default:
The number of digits to show
ex: 1234 commits and digits=3 => returns 1.2.3