Gathering detailed insights and metrics for git-log-parser
Gathering detailed insights and metrics for git-log-parser
Gathering detailed insights and metrics for git-log-parser
Gathering detailed insights and metrics for git-log-parser
npm install git-log-parser
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
24 Stars
31 Commits
11 Forks
3 Watching
3 Branches
3 Contributors
Updated on 01 Jul 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-2.4%
298,615
Compared to previous day
Last week
8.1%
1,907,361
Compared to previous week
Last month
28.2%
7,017,256
Compared to previous month
Last year
31%
58,227,079
Compared to previous year
Run git log
and return a stream of commit objects.
1$ npm install git-log-parser
log.parse(config, options)
-> Stream(commits)
Accepts a config
object mapping to the options accepted by git log
. config
will be automatically converted to command line options and flags by argv-formatter. Returns a stream of commit objects.
options
is passed directly to child_process.spawn
.
A commit is structured as follows:
1{ 2 commit: { 3 'long': '4bba6092ecb2571301ca0daa2c55336ea2c74ea2', 4 'short': '4bba609' 5 }, 6 tree: { 7 'long': 'b4ef3379e639f8c0034831deae8f6ce63dd41566', 8 'short': 'b4ef337' 9 }, 10 author: { 11 'name': 'Ben Drucker', 12 'email': 'bvdrucker@gmail.com', 13 'date': new Date('2014-11-20T14:39:01.000Z') 14 }, 15 committer: { 16 'name': 'Ben Drucker', 17 'email': 'bvdrucker@gmail.com', 18 'date': new Date('2014-11-20T14:39:01.000Z') 19 }, 20 subject: 'Initial commit', 21 body: 'The commit body' 22}
author.date
and commiter.date
are Date
objects while all other values are strings.
If you just want an array of commits, use stream-to-array to wrap the returned stream.
log.fields
-> Object
Commit objects contain the most frequently used commit information. However, the field mappings used to format and then parse log output can be amended before calling the parser. Consult the full range of formatting placeholders and add the placeholder to the object tree if you wish to add extra fields.
Get all commits from earlier than an hour ago and stream them to stdout
as pretty-printed JSON
1var log = require('git-log-parser'); 2var through2 = require('through2'); 3 4log.parse({ 5 before: new Date(Date.now() - 60 * 60 * 1000) 6}) 7.pipe(through2.obj(function (chunk, enc, callback) { 8 callback(null, JSON.stringify(chunk, undefined, 2)); 9})) 10.pipe(process.stdout);
Note that before
is stringified and passed directly as an argument to git log
. No special handling is required for any standard git log
option. You can filter by committer, time, or any other field supported by git log
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 2/30 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
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
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