A tool to get the branch name of a specific directory
Installations
npm install current-git-branch
Developer Guide
Typescript
Yes
Module System
ESM
Node Version
20.15.1
NPM Version
10.7.0
Score
98.1
Supply Chain
73.5
Quality
84.4
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
JPeer264
Download Statistics
Total Downloads
21,518,792
Last Day
28,553
Last Week
165,154
Last Month
639,370
Last Year
6,527,082
GitHub Statistics
MIT License
10 Stars
27 Commits
4 Forks
3 Watchers
1 Branches
2 Contributors
Updated on Jan 15, 2025
Package Meta Information
Latest Version
2.0.1
Package Id
current-git-branch@2.0.1
Unpacked Size
67.68 kB
Size
15.93 kB
File Count
88
NPM Version
10.7.0
Node Version
20.15.1
Published on
Jan 15, 2025
Total Downloads
Cumulative downloads
Total Downloads
21,518,792
Last Day
-5.3%
28,553
Compared to previous day
Last Week
18.2%
165,154
Compared to previous week
Last Month
35.3%
639,370
Compared to previous month
Last Year
7.8%
6,527,082
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
current-git-branch
Get synchronously the current branch name
Installation
1$ npm i current-git-branch --save
Usage
Returns:
- Boolean
false
: It is not a git repository - String: The branch name
1import branchName from "current-git-branch"; 2 3branchName(); // false or branch name of process.cwd() 4branchName({ cwd: "any/git/repo" }); // false or branch name of the directory 'any/git/repo' 5branchName({ 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

No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
6 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 6
Reason
5 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-vg6x-rcgg-rjx6
- Warn: Project is vulnerable to: GHSA-9crc-q9x8-hgqq
Reason
Found 1/27 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/JPeer264/node-current-git-branch/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/JPeer264/node-current-git-branch/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/JPeer264/node-current-git-branch/ci.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/JPeer264/node-current-git-branch/ci.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:22
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 2 are checked with a SAST tool
Score
3.5
/10
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More