1.0.0 • Published 5 years ago

last-commit-message v1.0.0

Weekly downloads
664
License
Apache-2.0
Repository
github
Last release
5 years ago

last-commit-message

Get the latest commit message in a git repository.

Install - Usage - License: Apache-2.0

npm travis standard

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'.

License

Apache-2.0