Package Exports
- tiny-conventional-commits-parser
Readme
tiny-conventional-commits-parser
A tiny conventional commits parser.
This package does not aim to provide features and APIs compatible with conventional-commits-parser, but only basic, simple parsing of conventional-commits.
Usage
import { getRecentCommits } from 'tiny-conventional-commits-parser'
getRecentCommits('v9.10.0', 'HEAD')
const rawCommit = {
author: {
email: 'author1@example.com',
name: 'author1',
},
body: '',
data: 'Thu Jan 23 17:42:15 2025 +0800',
message: 'feat(scope)!: commit message',
shortHash: '9cfa09f',
}
parseCommit(rawCommit)
{
"authors": [
{
"email": "author1@example.com",
"name": "author1"
}
],
"body": "",
"data": "Thu Jan 23 17:42:15 2025 +0800",
"description": "commit message",
"isBreaking": true,
"isConventional": true,
"message": "feat(scope)!: commit message",
"references": [],
"scope": "scope",
"shortHash": "9cfa09f",
"type": "feat"
}
License
MIT License
Acknowledgements
- unjs/changelogen: most of the code in this package comes from this package.
- conventional-commits-parser