https://github.com/integeralex/disposable-email-detector
This repository contains a Node.js utility for detecting disposable email addresses. It helps identify whether an email address belongs to a disposable email provider, aiding in the prevention of spam and unwanted sign-ups.
https://github.com/integeralex/disposable-email-detector
blackfire codescene collaborate deepscan deepsource email emailvalidator github github-copilot learn validation
Last synced: 6 months ago
JSON representation
This repository contains a Node.js utility for detecting disposable email addresses. It helps identify whether an email address belongs to a disposable email provider, aiding in the prevention of spam and unwanted sign-ups.
- Host: GitHub
- URL: https://github.com/integeralex/disposable-email-detector
- Owner: IntegerAlex
- License: mit
- Created: 2024-03-07T16:04:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-28T07:29:13.000Z (7 months ago)
- Last Synced: 2025-04-16T04:14:08.288Z (6 months ago)
- Topics: blackfire, codescene, collaborate, deepscan, deepsource, email, emailvalidator, github, github-copilot, learn, validation
- Language: TypeScript
- Homepage: https://disposable-email-detector-demo.vercel.app/
- Size: 1.73 MB
- Stars: 26
- Watchers: 1
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Disposable Email Detector
[](https://deepscan.io/dashboard#view=project&tid=23370&pid=26631&bid=850159)

[](https://app.deepsource.com/gh/IntegerAlex/disposable-email-detector/)
## Overview
The `disposable-email-detector` is a TypeScript utility designed to identify disposable email addresses, providing developers with a tool to enhance email verification processes.
## Demo
DEMO : [LIVE](https://disposable-email-detector-demo.vercel.app/)
DEMO REPO : [REPO](https://github.com/IntegerAlex/disposable-email-detector-demo)## Features
- **Domain Check:** Identifies if an email address belongs to a known disposable email domain.
- **Error Handling:** Offers informative messages for scenarios like missing `index.json` or invalid JSON format.
- **Async File Reading:** Utilizes asynchronous file reading for improved performance.## Getting Started
### Prerequisites
- Node.js
- npm### Implementation Details
```javascript
npm i disposable-email-detector
``````javascript
import disposableEmailDetector from 'disposable-email-detector';const email = 'test@mailinator.com';
disposableEmailDetector(email)
.then((response) => console.log(response)); // true
```The disposableEmailDetector function reads a list of disposable email domains from index.json. It checks whether the provided email address belongs to a disposable domain and returns a boolean indicating the result.
### Error Handling
- If `index.json` is not found, the script informs you to create it with disposable domains.
- If `index.json` has an invalid JSON format, it prompts you to correct the file.
- Unexpected errors are logged to the console.## Contributing
Contributions are welcome! Please refer to the [contributing guidelines](CONTRIBUTING.md) for more information.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
```