프로젝트
GitHub에서 보기
mfbx9da4/deep-email-validator
소개
정규식, 오타, 일회용 이메일 주소, DNS 및 SMTP를 검사합니다
시스템 및 인프라측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- -1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originaldeep-email-validator
Validates email addresses based on regex, common typos, disposable email blacklists, DNS records and SMTP server response.
- Validates email format (contains
@,.in domain, no spaces or control characters). - Validates common typos e.g.
[email protected]using mailcheck. - Validates email was not generated by a disposable email service using disposable-email-domains.
- Validates MX records are present on DNS.
- Validates SMTP server is running.
- Validates mailbox exists on SMTP server.
- Sanitizes inputs to prevent SMTP command injection.
- Native TypeScript support.
Getting Started
Requires Node.js >= 20. Server-side only (not browser compatible).
Installation
npm install deep-email-validator
Usage
import { validate } from 'deep-email-validator'
const res = await validate('[email protected]')
// {
// "valid": false,
// "reason": "smtp",
// "validators": {
// "regex": {
// "valid": true
// },
// "typo": {
// "valid": true
// },
// "disposable": {
// "valid": true
// },
// "mx": {
// "valid": true
// },
// "smtp": {
// "valid": false,
// "reason": "Mailbox not found.",
// }
// }
// }
You can also pass an options object to control which validations run:
await validate({
email: '[email protected]',
sender: '[email protected]',
validateRegex: true,
validateMx: true,
validateTypo: true,
validateDisposable: true,
validateSMTP: true,
})
Default options can be found here.
Custom TLDs
If you want to validate domains with TLDs that are not supported by default, use the additionalTopLevelDomains option:
await validate({
email: '[email protected]',
additionalTopLevelDomains: ['ir'],
})
For a list of TLDs supported by default, see mailcheck defaults.
CommonJS usage
const { validate } = require('deep-email-validator')
const res = await validate('[email protected]')
관련 프로젝트 살펴보기
불러오는 중…