Skip to content

A Node.js library for email verification without sending any emails.

License

Notifications You must be signed in to change notification settings

everyx/node-email-verifier

Repository files navigation

@everyx/email-verifier

A Node.js library for email verification without sending any emails.

It's based on the Go AfterShip/email-verifier library and use node-ffi-rs for the FFI call.

Currently, it it only supports Linux and Windows systems, and has exported two methods: suggestDomain and verify, with SMTP verification not enabled.

More information, checkout AfterShip/email-verifier.

Install

$ pnpm install @everyx/email-verifier

Usage

import { suggestDomain, verify } from '@everyx/email-verifier'

const data = await verify('[email protected]')
// {
//   data: {
//      email: '[email protected]',
//      reachable: 'unknown',
//      syntax: { username: 'name', domain: 'example.com', valid: true },
//      smtp: null,
//      gravatar: null,
//      suggestion: '',
//      disposable: false,
//      role_account: false,
//      free: true,
//      has_mx_records: true
//   },
//   error: null
// }

// Enable SMTP check
const data = await verify('[email protected]', { enableSMTPCheck: true })
// {
//   data: {
//     email: '[email protected]',
//     reachable: 'no',
//     syntax: { username: 'name', domain: 'gmail.com', valid: true },
//     smtp: {
//       host_exists: true,
//       full_inbox: false,
//       catch_all: false,
//       deliverable: false,
//       disabled: false
//     },
//     gravatar: null,
//     suggestion: '',
//     disposable: false,
//     role_account: false,
//     free: true,
//     has_mx_records: true
//   },
//   error: null
// }

const domain = await suggestDomain('gmai.com')
// gmail.com

About

A Node.js library for email verification without sending any emails.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •