2.0.1 • Published 5 months ago

current-git-branch v2.0.1

Weekly downloads
26,090
License
MIT
Repository
github
Last release
5 months ago

current-git-branch

Build Status Coverage Status

Get synchronously the current branch name

Installation

$ npm i current-git-branch --save

Usage

Returns:

  • Boolean false: It is not a git repository
  • String: The branch name
import branchName from "current-git-branch";

branchName(); // false or branch name of process.cwd()
branchName({ cwd: "any/git/repo" }); // false or branch name of the directory 'any/git/repo'
branchName({ cwd: "any/git/repo", branchOptions: ["--no-color"] }); // alternatively, you may pass git-branch command options, either as a string or an array

LICENSE

MIT © Jan Peer Stöcklmair

2.0.1

5 months ago

2.0.0

5 months ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

8 years ago