husky-check-email
Version:
check email for domain before git commit
57 lines (47 loc) • 1.68 kB
Markdown
# husky-check-email
[](https://npm.im/husky-check-email)
[](https://npm.im/husky-check-email)

[](https://david-dm.org/jehy/husky-check-email)
[](https://david-dm.org/jehy/husky-check-email?type=dev)
[](https://coveralls.io/github/jehy/husky-check-email?branch=master)
[](https://snyk.io/test/github/jehy/husky-check-email)
Add this module to only allow git commits with emails from certain domain.
#### Install
```bash
npm i husky-check-email
```
#### Usage (package.json)
If you want to validate email against one domain:
```json
{
"husky": {
"hooks": {
"pre-commit": "husky-check-email @mydomain.com"
}
}
}
```
If you want to validate email against several domains:
```json
{
"husky": {
"hooks": {
"pre-commit": "husky-check-email @mydomain.com,@mail.ru"
}
}
}
```
You can also validate using a regex:
```json
{
"husky": {
"hooks": {
"pre-commit": "husky-check-email @mydomain.[a-z]+"
}
}
}
```
#### See also
* [husky-check-name](https://www.npmjs.com/package/husky-check-name)
* [husky-add-issue-tracker](https://www.npmjs.com/package/husky-add-issue-tracker)