NiceLabs / git-rev

Synchronously get the current git commit hash, tag, or branch

Home Page:https://npm.im/@nice-labs/git-rev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@nice-labs/git-rev

node version npm module

Synchronously get the current git commit hash, tag, count, branch or commit message.

Forked from git-rev-sync-js.

usage

import git from '@nice-labs/git-rev';

// short commit-hash
console.log(git.commitHash(true)); // 75bf4ee

// long commit-hash
console.log(git.commitHash()); // 75bf4eea9aa1a7fd6505d0d0aa43105feafa92ef

// branch name
console.log(git.branchName()); // master

installation

npm install --save-dev @nice-labs/git-rev

About

Synchronously get the current git commit hash, tag, or branch

https://npm.im/@nice-labs/git-rev

License:MIT License


Languages

Language:TypeScript 97.6%Language:Shell 2.4%