Skip to content

Commit 8c622b6

Browse files
committed
docs(commit-history): add README and package.json for Commit History package
1 parent 3d966d2 commit 8c622b6

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

packages/commit-history/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# @commit-generator/commit-history
2+
3+
This package provides a utility for **managing commit message history** in the **Commit Generator** project. It allows storing and retrieving generated commit messages.
4+
5+
## Installation
6+
To use the commit history utility in your project, install the package:
7+
8+
```bash
9+
pnpm install @commit-generator/commit-history
10+
```
11+
12+
## Usage
13+
After installation, you can use the commit history utility in your project.
14+
15+
1. Adding a Commit to History.
16+
To store a generated commit message, use the `add` method:
17+
18+
```javascript
19+
import { CommitHistory } from '@commit-generator/commit-history';
20+
21+
const history = new CommitHistory("./commit-history.log");
22+
23+
await history.add("feat: add new feature");
24+
```
25+
26+
2. Retrieving Commit History.
27+
To retrieve the last *N* commit messages, use the `get` method:
28+
29+
```javascript
30+
const lastCommits = await history.get(5);
31+
console.log(lastCommits);
32+
```
33+
34+
## License
35+
This package is licensed under the MIT License.

packages/commit-history/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"name": "@commit-generator/commit-history",
3+
"version": "0.0.0",
4+
"description": "A utility for managing commit message history.",
5+
"author": "JulioC090",
36
"exports": {
47
".": {
58
"types": "./dist/index.d.ts",
@@ -8,6 +11,15 @@
811
"default": "./dist/index.js"
912
}
1013
},
14+
"repository": {
15+
"type": "git",
16+
"url": "https://github.com/JulioC090/commit-generator.git",
17+
"directory": "packages/commit-history"
18+
},
19+
"bugs": {
20+
"url": "https://github.com/JulioC090/commit-generator/issues"
21+
},
22+
"license": "MIT",
1123
"scripts": {
1224
"build": "tsup --format cjs,esm",
1325
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",

0 commit comments

Comments
 (0)