last-commit-message
v1.0.0
Published
Get the latest commit message in a git repository.
Downloads
43
Maintainers
Readme
last-commit-message
Get the latest commit message in a git repository.
Install - Usage - License: Apache-2.0
Install
npm install last-commit-message
Usage
var lastCommitMessage = require('last-commit-message')
lastCommitMessage().then(function (message) {
console.log('latest message:', message)
})
lastCommitMessage({ cwd: '/path/to/repo' }).then(function (message) {
console.log('latest message:', message)
})
API
lastCommitMessage(opts={})
Returns a Promise for the most recent commit message as a string.
Specify opts.cwd
to check for the message in a specific repository.
If the repository does not contain any commits, the Promise rejects with an error error.message === 'Empty repository'
.