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