@ong/git-info

Get the reop HEAD info.

Usage no npm install needed!

<script type="module">
  import ongGitInfo from 'https://cdn.skypack.dev/@ong/git-info';
</script>

README

@ong/git-info

Get the git repo HEAD info.

CircleCI branch npm (scoped) GitHub

Usage

npm install @ong/git-info
import gitInfo from '@ong/git-info'
const {
  repo,    // the repo to get info
  status,  // whether or not correctly get the info, true for success false for fail
  message, // empty or error message
  branch,  // current branch
  hash     // commit hash code
} = gitInfo(hashLen/* hash length, default is 8*/, path/* repo path, default is current working dir */)