What is @commitlint/read?
@commitlint/read is an npm package that provides functionality to read and parse commit messages. It is typically used in conjunction with commitlint to enforce commit message conventions.
What are @commitlint/read's main functionalities?
Read commit messages from a file
This feature allows you to read commit messages from a specified range of commits. In this example, it reads the commit message from the last commit.
const read = require('@commitlint/read');
read({from: 'HEAD~1', to: 'HEAD'}).then((messages) => {
console.log(messages);
});
Read commit messages from stdin
This feature allows you to read commit messages from the standard input. This is useful for integrating with other tools that provide commit messages via stdin.
const read = require('@commitlint/read');
process.stdin.on('data', (data) => {
read({edit: true}).then((messages) => {
console.log(messages);
});
});
Other packages similar to @commitlint/read
conventional-changelog
conventional-changelog is a package that reads commit messages and generates changelogs based on conventional commit messages. It provides more extensive functionality for generating changelogs and release notes compared to @commitlint/read.
git-raw-commits
git-raw-commits is a package that reads raw commit messages from a git repository. It is similar to @commitlint/read in that it focuses on reading commit messages, but it provides more low-level access to the raw commit data.
@commitlint/read
Read commit messages from a specified range or last edit
Getting started
npm install --save @commitlint/read
Documentation
Consult API docs for comprehensive documentation.
Documentation generated from docs
folder.