validate-branch-name can be used through command line directly. When using with Husky, you should make sure husky version >= v1.0.0.
Install
# local install
$ npm i validate-branch-name -D
# global install
$ npm i validate-branch-name -g
Usage
Use through command line
npx validate-branch-name
# test target branch name
npx validate-branch-name -t test/branch/name
# define regexp to test branch name
npx validate-branch-name -r regexp -t test/branch/name
# use -h for more usage detail
npx validate-branch-name -h
You can also use .validate-branch-namerc, .validate-branch-namerc.json, .validate-branch-namerc.yaml, .validate-branch-namerc.yml, .validate-branch-namerc.js, .validate-branch-namerc.cjs,
validate-branch-name.config.js or validate-branch-name.config.cjs file to define config.