git-local-info
Badges
gitInfo
Retrieves repo information without relying on the git
command.
Usage
// install
$ npm install git-local-info -S
; const gitInfo = ; const result = gitInfogetGitInfo; // result is: /** The current branch */ branch: string; /** The current repository url */ repository: string; /** SHA of the current commit */ sha: string; /** The committer of the current SHA */ commit: ICommit; /** The commit message for the current SHA */ rootDir: string;
Params
new GitInfo(params);
// params // default process.cwd() gitPath: process // default .git GIT_DIR: '.git'