This package provides a utility for managing commit message history in the Commit Generator project. It allows storing and retrieving generated commit messages.
To use the commit history utility in your project, install the package:
pnpm install @commit-generator/commit-history
After installation, you can use the commit history utility in your project.
- Adding a Commit to History.
To store a generated commit message, use theadd
method:
import { CommitHistory } from '@commit-generator/commit-history';
const history = new CommitHistory("./commit-history.log");
await history.add("feat: add new feature");
- Retrieving Commit History.
To retrieve the last N commit messages, use theget
method:
const lastCommits = await history.get(5);
console.log(lastCommits);
This package is licensed under the MIT License.