https://github.com/javierbyte/node-git-history
A git wrapper for node to get a repo history data
https://github.com/javierbyte/node-git-history
Last synced: 4 months ago
JSON representation
A git wrapper for node to get a repo history data
- Host: GitHub
- URL: https://github.com/javierbyte/node-git-history
- Owner: javierbyte
- Created: 2017-08-14T03:36:56.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-14T04:01:58.000Z (almost 8 years ago)
- Last Synced: 2025-01-05T22:27:32.368Z (6 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
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(, )
```See the [Argument options](#argument-options) section.
### Example
```js
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 hash
* `h`: Abbreviated commit hash
* `T`: Tree hash
* `t`: Abbreviated tree hash
* `P`: Parent hashes
* `p`: Abbreviated parent hashes
* `an`: Author name
* `ae`: Author email
* `ad`: Author date (format respects the --date=option)
* `ar`: Author date, relative
* `cn`: Committer name
* `ce`: Committer email
* `cd`: Committer date
* `cr`: Committer date, relative
* `s`: 'Subject## License
MIT