$ npm install conventional-recommended-bumpGet a recommended version bump based on conventional commits.
Got the idea from https://github.com/conventional-changelog/conventional-changelog/pull/29
# pnpm
pnpm add conventional-recommended-bump
# yarn
yarn add conventional-recommended-bump
# npm
npm i conventional-recommended-bump
import { Bumper } from 'conventional-recommended-bump'
const bumper = new Bumper().loadPreset('angular')
const recommendation = await bumper.bump()
console.log(recommendation.releaseType) // 'major'
new Bumper(cwdOrGitClient: string | ConventionalGitClient = process.cwd())Create a new Bumper instance. cwdOrGitClient is the current working directory or a ConventionalGitClient instance.
bumper.tag(paramsOrTag: GetSemverTagsParams | string): thisSet params to get the last semver tag or set the tag directly.
bumper.commits(params: GetCommitsParams, parserOptions?: ParserStreamOptions): thisSet params to get the commits.
bumper.commits(commits: Iterable<Commit> | AsyncIterable<Commit>): thisSet the commits directly.
bumper.loadPreset(preset: PresetParams): thisLoad and set necessary params from a preset.
generator.config(config: Preset | Promise<Preset>): thisSet the config directly.
bumper.bump(whatBump?: (commits: Commit[]) => Promise<BumperRecommendation | null | undefined>): Promise<BumperRecommendation>Get a recommended version bump based on conventional commits. whatBump function is required if preset is not loaded.
conventional-recommended-bump --help
MIT © Steve Mao