JSPM

current-git-branch

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

A tool to check if files are added in a git repository

Package Exports

  • current-git-branch

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 (current-git-branch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

current-git-branch

Build Status Build status Coverage Status

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 = require('current-git-branch');

branchName(); // false or branch name of process.cwd()
branchName('any/git/repo'); // false or branch name of the directory 'any/git/repo'

LICENSE

MIT © Jan Peer Stöcklmair