0.1.4 • Published 4 years ago

autoversion-git v0.1.4

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

Autoversion Build Status

Display Version on your websites using github releases / commits

Example

Sample Repository

Header

Fetched Repository

Header Footer

Getting started

Install

$ npm install autoversion-git

Usage - Require (Node)

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);

Usage - VueJS/React

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);

API

getReleaseVersion(owner, repo)

owner

Type: string

Owner of the github repository

repo

Type: string

Repository Name

getCommitVersion(owner, repo, shaOrBranch, digits)

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: int Default: 3

The number of digits to show ex: 1234 commits and digits=3 => returns 1.2.3

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago