JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1466104
  • Score
    100M100P100Q200266F
  • License MIT

Retrieve current sha and branch name from a git repo.

Package Exports

  • git-repo-info

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (git-repo-info) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

git-repo-info

Retrieves repo information without relying on the git command.

Usage

var getRepoInfo = require('git-repo-info');

var info = getRepoInfo();

info.branch         //=> will be the current branch
info.sha            //=> will be the current sha
info.abbreviatedSha //=> will be the first 10 chars of the current sha

When called without any arguments, git-repo-info will automatically lookup upwards into parent directories to find the first match with a .git folder.

If passed an argument, it will be assumed to be the path to the repo's .git folder to inspect.