current-git-branch
Get synchronously the current branch name
Installation
$ npm i current-git-branch --save
or
$ yarn add current-git-branch
Usage
Returns:
- Boolean
false
: It is not a git repository - String: The branch name
const branchName = ; ; // false or branch name of process.cwd(); // false or branch name of the directory 'any/git/repo'; // alternatively, you may pass git-branch command options, either as a string or an array
LICENSE
MIT © Jan Peer Stöcklmair