UNPKG

640 BMarkdownView Raw
1> Read commit messages from a specified range or last edit
2
3# @commitlint/read
4
5## Getting started
6
7```shell
8npm install --save @commitlint/read
9```
10
11## Example
12
13```js
14const read = require('@commitlint/read').default;
15
16// Read last edited commit message
17read({edit: true}).then((messages) => console.log(messages));
18// => ['I did something\n\n']
19
20// Read from the third to second commit message from HEAD
21read({from: 'HEAD~2', to: 'HEAD~1'}).then((messages) => console.log(messages));
22// => ['Initial commit\n\n']
23```
24
25Consult [docs/api](https://conventional-changelog.github.io/commitlint/#/reference-api) for comprehensive documentation.