commit-hash
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "commit-hash", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Get commit hash from a branch name, tag, or reference", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/dgoguerra/commit-hash#readme", |
@@ -11,4 +11,29 @@ ## commit-hash | ||
### Usage | ||
```js | ||
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' | ||
}); | ||
``` | ||
### License | ||
MIT license - http://www.opensource.org/licenses/mit-license.php |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9368
39