0.3.4 • Published 2 years ago

@corteks/gitversion v0.3.4

Weekly downloads
166
License
GPL V3
Repository
github
Last release
2 years ago

This package extract informations from your git repository to help you generate version number dynamically.

Inspired by: https://github.com/smessmer/gitversion

Usage: yarn install @corteks/gitversion

import gitVersion from '@corteks/gitversion'

gitVersion()
    .then((informations) => {
        console.log(informations)
    })
    .catch((err) => {
        console.error(err)
    })
const gitVersion = require('@corteks/gitversion').default

gitVersion()
    .then((informations) => {
        console.log(informations)
    })
    .catch((err) => {
        console.error(err)
    })

This ouputs:

{
    COMMITS_SINCE_TAG: 22,
    CURRENT_BRANCH: 'master',
    CURRENT_COMMIT_ID:'c1a78a93f8e1735cf1ac86a218b973cc654fe482',
    CURRENT_COMMIT_SHORT_ID: 'c1a78a9',
    LAST_TAG_NAME: 1.2.7,
    MODIFIED_SINCE_COMMIT: true
}

There is also a default format directly accessible via:

import { getFormattedVersion } from '@corteks/gitversion';

getFormattedVersion()
    .then((version) => {
        console.log(version);
    })
    .catch((err) => {
        console.error(err);
    });
0.3.4

2 years ago

0.3.3

3 years ago

0.3.2

4 years ago

0.3.0

4 years ago

0.3.1

4 years ago

0.2.0

5 years ago

0.1.0

5 years ago