Installations
npm install git-rev-2
Developer Guide
Typescript
No
Module System
CommonJS
NPM Version
1.3.22
Score
69.6
Supply Chain
98.2
Quality
74.7
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
yanatan16
Download Statistics
Total Downloads
1,205,993
Last Day
141
Last Week
616
Last Month
2,946
Last Year
158,236
GitHub Statistics
MIT License
1 Stars
16 Commits
3 Forks
3 Watchers
1 Branches
1 Contributors
Updated on Feb 09, 2015
Package Meta Information
Latest Version
0.1.0
Package Id
git-rev-2@0.1.0
Size
2.44 kB
NPM Version
1.3.22
Total Downloads
Cumulative downloads
Total Downloads
1,205,993
Last Day
16.5%
141
Compared to previous day
Last Week
-24.4%
616
Compared to previous week
Last Month
57.2%
2,946
Compared to previous month
Last Year
-60.8%
158,236
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
git-rev
Access git revision state in node. Forked from https://github.com/tblobaum/git-rev. Modified to accept a custom directory and pass back errors.
npm install git-rev-2
Example
1var git = require('git-rev') 2 3git.short(function (err, str) { 4 console.log('short', str) 5 // => aefdd94 6}) 7 8git.long(__dirname + "../another-git-dir", function (err, str) { 9 console.log('long', str) 10 // => aefdd946ea65c88f8aa003e46474d57ed5b291d1 11}) 12 13git.branch(function (err, str) { 14 console.log('branch', str) 15 // => master 16}) 17 18git.tag(__dirname + "node_modules/some-git-repo", function (err, str) { 19 console.log('tag', str) 20 // => 0.1.0 21}) 22
Methods
1var git = require('git-rev')
.log([dir,] function (err, array) { ... })
return the git log of process.cwd()
as an array
1git.log(function (err, array) { 2 console.log('log', array) 3 // [ [ 'aefdd946ea65c88f8aa003e46474d57ed5b291d1', 4 // 'add description', 5 // '7 hours ago', 6 // 'Thomas Blobaum' ], 7 // [ '1eb9a6c8633a5a47a47487f17b17ae545d0e26a8', 8 // 'first', 9 // '7 hours ago', 10 // 'Thomas Blobaum' ], 11 // [ '7f85b750b908d28bfeb13ad6dba47d9d604508f9', 12 // 'first commit', 13 // '2 days ago', 14 // 'Thomas Blobaum' ] ] 15})
.short([dir,] function (err, commit) { ... })
return the result of git rev-parse --short HEAD
.long([dir,] function (err, commit) { ... })
return the result of git rev-parse HEAD
.tag([dir,] function (err, tag) { ... })
return the current tag
.branch([dir,] function (err, branch) { ... })
return the current branch
License
(The MIT License)
Copyright (c) 2012 Thomas Blobaum tblobaum@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 1/16 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
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
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 1 are checked with a SAST tool
Score
3
/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