Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
branch-name
Advanced tools
Get the current branch name
$PATH
.npm install branch-name --save
Get it into your program.
const branchName = require('branch-name');
Get the current branch name.
branchName.get().then((name) => {
console.log(name);
});
Get the current branch name, but with a fallback result for detached head and non-repository situations.
branchName.assume('dev').then((name) => {
console.log(name); // prints current branch if possible, 'dev' otherwise
});
Get the current branch name, with the default master
as a fallback.
branchName.assumeMaster().then((name) => {
console.log(name); // prints current branch if possible, 'master' otherwise
});
Returns the branch name that HEAD points to. Throws an error if not in a git repository or HEAD is not a branch.
Similar to .get()
, but will return name
if not in a git repository or the HEAD is detached.
Similar to .assume()
but always uses "master" as the fallback name.
Type: object
Type: string
Default: process.cwd()
Directory whose branch you want determine.
See our contributing guidelines for more details.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
Go make something, dang it.
FAQs
Get the current branch name
The npm package branch-name receives a total of 8,538 weekly downloads. As such, branch-name popularity was classified as popular.
We found that branch-name demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.