git-log-nodejs is a tool to get git logs.
This call Git™ commands inside and parse the result to be easy to control with JavaScript.
We are guessing use this to check git log info like a linting with JavaScript.
git-log-nodejs is published under GPL 2.0 license because also Git is published under GPL 2.0.
You must install Git and add it to environment PATH.
Please install git-log-nodejs with npm install
.
npm i git-log-nodejs
import {commits} from 'git-log-nodejs';
const commitList = await commits();
See the types for details.
Get the list of local.
Get the list of branches along with the remote name.
Commit.author
: Pick<Author, 'email' | 'name'>
Hash of the parent commit. The merge commit has two parents.
Commit.files
: File[]
The list of files included in this commit.
Type of Remote
is Record<string, { fetch: string, push: string }>
. Record
is one of the Utility Types
origin
is remoteName. It depends on your settings.
origin
is remoteName. It depends on your settings.
See the types for details.
Get author info with git shortlog
command.
0.1.0
logOption
filtering logs with branchName. default is 'HEAD'
.
Get branch info with git branch
command.
0.3.0
- withRemote
To get remote info, set it true
. default is true
.
Get commit info with git log
command.
0.1.0
logOption
How many log to get. default is 1000
. 0
is no limit.
Whether to get file name. default is false
.
Filtering logs with branch name. default is ''
.
Get config info with git config --list
.
0.1.0
- nothing
- Config: object
Depends on your settings. See git-config Documentation.
Get remote info with git remote -v
command.
0.2.0
- nothing
Get the list of changed file with git status -s
command.
0.5.0
- nothing
Get tag info with git show-ref --tags
command.
0.4.0
- nothing