Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
commit-hash
Advanced tools
Obtain a repository's commit hash from a branch name, tag, or reference.
npm install commit-hash
var commitHash = require('commit-hash');
// looking up a short commit hash, in a project in the current directory
commitHash('21f6b', function(err, hash) {
console.log(hash); // => '21f6ba4e644e77d6e20eaa5156a928b6d75fdf76'
});
// looking up a tag with modifiers, in a project somewhere else
commitHash('v0.1.0^^', {dir: '/home/dgo/repos/commit-hash'}, function(err, hash) {
console.log(hash); // => '285d19c23a56662bab97c75b4bfc80a175dfdae2'
});
// looking up a remote branch, after fetching from all remotes
// to ensure the local repo has updated references
commitHash('origin/tests-unused-branch', {
dir: '/home/dgo/repos/commit-hash',
fetch: true
}, function(err, hash) {
console.log(hash); // => '3f07195438a6a846554ed4b8cd7b3223a8c5e91e'
});
MIT license - http://www.opensource.org/licenses/mit-license.php
FAQs
Get commit hash from a branch name, tag, or reference
The npm package commit-hash receives a total of 2 weekly downloads. As such, commit-hash popularity was classified as not popular.
We found that commit-hash 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.
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.