node-git-history
v1.0.2
Published
A git wrapper for node to get a repo history data
Downloads
5
Readme
node-git-history
A dependency-free git log wrapper for node to get a git repo history data. Only works on Mac and Linux.
Tested on node 8 and git 2.
How to use
nodeGitHistory(<path to the git directory>, <options array>)
See the Argument options section.
Example
const nodeGitHistory = require('node-git-history');
nodeGitHistory("/", [
"H", // commit hash
"an", // author name
"ae", // author email
"ad", // author date
"s" // subject
])
.then(res => {
console.log(`RESPONSE`, res)
/*
'res' is going to look like this:
{ H: '0b8c4b541d955a02168064c4d5782d054fc54a87',
an: 'Javier Bórquez',
ae: '[email protected]',
ad: 'Sun Apr 30 19:18:05 2017 -0600',
s: 'Add dist code' },
{ H: '39cdee04986274252b834fd7a80a147a27ac0961',
an: 'Javier Bórquez',
ae: '[email protected]',
ad: 'Sun Apr 30 19:15:47 2017 -0600',
s: 'Initial commit' } ]
*/
})
Argument options
H
: Commit hashh
: Abbreviated commit hashT
: Tree hasht
: Abbreviated tree hashP
: Parent hashesp
: Abbreviated parent hashesan
: Author nameae
: Author emailad
: Author date (format respects the --date=option)ar
: Author date, relativecn
: Committer namece
: Committer emailcd
: Committer datecr
: Committer date, relatives
: 'Subject
License
MIT