{"id":15828690,"url":"https://github.com/jesselpalmer/node-email-verifier","last_synced_at":"2025-06-20T09:07:24.357Z","repository":{"id":145917219,"uuid":"79076926","full_name":"jesselpalmer/node-email-verifier","owner":"jesselpalmer","description":"A Node.js module for verifying email addresses","archived":false,"fork":false,"pushed_at":"2025-06-14T20:16:12.000Z","size":209,"stargazers_count":9,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-14T20:24:35.965Z","etag":null,"topics":["email-validation","email-validator","email-verification","email-verifier"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jesselpalmer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"jesselpalmer"}},"created_at":"2017-01-16T02:50:46.000Z","updated_at":"2025-06-14T19:58:53.000Z","dependencies_parsed_at":"2023-11-11T21:20:44.337Z","dependency_job_id":"784c851e-7e33-48f6-b825-937e4c5fd0b6","html_url":"https://github.com/jesselpalmer/node-email-verifier","commit_stats":null,"previous_names":["jesselpalmer/node-email-validator"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/jesselpalmer/node-email-verifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesselpalmer%2Fnode-email-verifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesselpalmer%2Fnode-email-verifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesselpalmer%2Fnode-email-verifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesselpalmer%2Fnode-email-verifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jesselpalmer","download_url":"https://codeload.github.com/jesselpalmer/node-email-verifier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesselpalmer%2Fnode-email-verifier/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259879979,"owners_count":22925867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email-validation","email-validator","email-verification","email-verifier"],"created_at":"2024-10-05T10:41:52.905Z","updated_at":"2025-06-20T09:07:19.342Z","avatar_url":"https://github.com/jesselpalmer.png","language":"TypeScript","funding_links":["https://github.com/sponsors/jesselpalmer"],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/dw/node-email-verifier.svg)](https://www.npmjs.com/package/node-email-verifier)\n[![Node.js CI](https://github.com/jesselpalmer/node-email-verifier/actions/workflows/nodejs-ci..yml/badge.svg)](https://github.com/jesselpalmer/node-email-verifier/actions/workflows/nodejs-ci..yml)\n\n# Node Email Verifier\n\nNode Email Verifier is an email validation library for Node.js that checks if an\nemail address has a valid format and optionally verifies the domain's MX\n(Mail Exchange) records to ensure it can receive emails.\n\n## Features\n\n- **RFC 5322 Format Validation**: Validates email addresses against the standard\n  email formatting rules.\n- **MX Record Checking**: Verifies that the domain of the email address has\n  valid MX records indicating that it can receive emails. This check can be\n  disabled using a parameter.\n- **Customizable Timeout**: Allows setting a custom timeout for MX record\n  checking.\n\n## Installation\n\nInstall the package using npm:\n\n```bash\nnpm install node-email-verifier --save\n```\n\n## Usage\n\nHere's how to use Node Email Verifier, with and without MX record checking:\n\n```javascript\nimport emailValidator from 'node-email-verifier';\n\n// Example with MX record checking\nasync function validateEmailWithMx(email) {\n  try {\n    const isValid = await emailValidator(email, { checkMx: true });\n    console.log(`Is \"${email}\" a valid email address with MX checking?`, isValid);\n  } catch (error) {\n    console.error('Error validating email with MX checking:', error);\n  }\n}\n\n// Example with MX record checking and custom timeout\nasync function validateEmailWithMxTimeout(email) {\n  try {\n    const isValid = await emailValidator(email, { checkMx: true, timeout: '500ms' });\n    console.log(`Is \"${email}\" a valid email address with MX checking and custom timeout?`, isValid);\n  } catch (error) {\n    if (error.message.match(/timed out/)) {\n      console.error('Timeout on DNS MX lookup.');\n    } else {\n      console.error('Error validating email with MX checking:', error);\n    }\n  }\n}\n\n// Example with custom timeout as a number\nasync function validateEmailWithMxTimeoutNumber(email) {\n  try {\n    const isValid = await emailValidator(email, { checkMx: true, timeout: 500 });\n    console.log(`Is \"${email}\" a valid email address with MX checking and custom timeout?`, isValid);\n  } catch (error) {\n    if (error.message.match(/timed out/)) {\n      console.error('Timeout on DNS MX lookup.');\n    } else {\n      console.error('Error validating email with MX checking:', error);\n    }\n  }\n}\n\n// Example without MX record checking\nasync function validateEmailWithoutMx(email) {\n  try {\n    const isValid = await emailValidator(email, { checkMx: false });\n    console.log(`Is \"${email}\" a valid email address without MX checking?`, isValid);\n  } catch (error) {\n    console.error('Error validating email without MX checking:', error);\n  }\n}\n\nvalidateEmailWithMx('test@example.com').then();\nvalidateEmailWithMxTimeout('test@example.com').then();\nvalidateEmailWithMxTimeoutNumber('test@example.com').then();\nvalidateEmailWithoutMx('test@example.com').then();\n```\n\n## API\n\n### ```async emailValidator(email, [opts])```\n\nValidates the given email address, with an option to skip MX record verification\nand set a custom timeout.\n\n#### Parameters\n\n- ```email``` (string): The email address to validate.\n- ```opts``` (object): Optional configuration options.\n- ```timeout``` (string|number): The timeout for the DNS MX lookup, in\n  milliseconds or ms format (e.g., '2000ms' or '10s'). The default is 10 seconds\n  ('10s').\n- ```checkMx``` (boolean): Whether to check for MX records. This defaults to\n  true.\n\n#### Returns\n\n- ```Promise\u003cboolean\u003e```: A promise that resolves to true if the email address\nis valid and, if checked, has MX records; false otherwise.\n\n## Contributing\n\nContributions are always welcome! Feel free to submit a PR.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjesselpalmer%2Fnode-email-verifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjesselpalmer%2Fnode-email-verifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjesselpalmer%2Fnode-email-verifier/lists"}