Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/goto-bus-stop/last-commit-message
Get the latest commit message in a git repository.
https://github.com/goto-bus-stop/last-commit-message
commit git latest message repository version-control
Last synced: 28 days ago
JSON representation
Get the latest commit message in a git repository.
- Host: GitHub
- URL: https://github.com/goto-bus-stop/last-commit-message
- Owner: goto-bus-stop
- License: other
- Created: 2019-05-27T10:42:22.000Z (over 5 years ago)
- Default Branch: default
- Last Pushed: 2021-07-27T04:55:41.000Z (over 3 years ago)
- Last Synced: 2024-10-05T16:25:35.377Z (about 1 month ago)
- Topics: commit, git, latest, message, repository, version-control
- Language: JavaScript
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# last-commit-message
Get the latest commit message in a git repository.
[Install](#install) - [Usage](#usage) - [License: Apache-2.0](#license)
[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url]
[![standard][standard-image]][standard-url][npm-image]: https://img.shields.io/npm/v/last-commit-message.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/last-commit-message
[travis-image]: https://img.shields.io/travis/com/goto-bus-stop/last-commit-message/master.svg?style=flat-square
[travis-url]: https://travis-ci.com/goto-bus-stop/last-commit-message
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: http://npm.im/standard## Install
```
npm install last-commit-message
```## Usage
```js
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](LICENSE.md)