Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

last-commit-log


NPM version build status Test coverage node version npm download

Node.js module to get the last git commit information - mostly to be used by CI/CD and building phase.

Who are using

For more

Usage

const LCL = require('last-commit-log');
const lcl = new LCL(); // or `new LCL(dir)` dir is process.cwd() by default

Asychronous use, using a Promise:

lcl
  .getLastCommit()
  .then(commit => console.log(commit));

Synchronous use:

const commit = lcl.getLastCommitSync();

full examples

commit information is an object like this:

{
  "gitTag": "2.0.0",
  "gitBranch": "master",
  "gitRemote": "git@github.com:group/repo.git", // .git http or ssh
  "gitUrl": "http://github.com/group/repo",     // url only
  "shortHash": "42dc921",
  "hash": "42dc921d25a3e7e1607302d2acfdc3fd991c0c01",
  "subject": "chore: add lock",
  "sanitizedSubject": "chore-add-lock",
  "body": "",
  "committer": {
    "date": "1515240839",
    "relativeDate": "2 hours ago",
    "name": "Committer Fred",
    "email": "fred@fred.com"
  },
  "author": {
    "date": "1515240839",
    "relativeDate": "2 hours ago",
    "name": "Author Baz",
    "email": "baz@baz.com"
  }
}

inspired by git-last-commit and fixed the parsing issue.

Contributors


zhangyuheng


xudafeng


stared


hi-yinyue

This project follows the git-contributor spec, auto updated at Sat Aug 08 2020 12:30:44 GMT+0800.

License

The MIT License (MIT)

About

Node.js module to get the last git commit information - mostly to be used by CI/CD and building phase.

Topics

Resources

License

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
You can’t perform that action at this time.