Skip to content

Provides a JavaScript package to determine if an email domain is disposable, using data from the disposable-email-domains repository.

License

Notifications You must be signed in to change notification settings

mziyut/disposable-email-domains-js

Repository files navigation

disposable-email-domains-js

NPM test CodeQL codecov

This package determines whether an email domain is disposable. The data used in this package is provided by disposable-email-domains/disposable-email-domains and was created to be offered as an NPM package.

Usage

var disposableEmailDomains = require('disposable-email-domains-js');

disposableEmailDomains.isDisposableEmailDomain('example.com'); // return false
disposableEmailDomains.isDisposableEmail('[email protected]'); // return false

disposableEmailDomains.isDisposableEmailDomain('mailinator.com'); // return true
disposableEmailDomains.isDisposableEmail('[email protected]'); // return true
import {
  isDisposableEmail,
  isDisposableEmailDomain,
} from 'disposable-email-domains-js';

isDisposableEmailDomain('example.com'); // return false
isDisposableEmail('[email protected]'); // return false

isDisposableEmailDomain('mailinator.com'); // return true
isDisposableEmail('[email protected]'); // return true

Development & Contribution

  • Use TypeScript and Prettier for all code. Run npm run lint to check, npm run lint:fix to auto-fix.
  • All code and examples should pass npm run build and npm run test.
  • PRs and issues are welcome. For blocklist changes, contribute upstream first (disposable-email-domains/disposable-email-domains)。

CI/CD

GitHub Actions automatically run tests, lint, and build on all PRs and pushes. Domain list updates and package publishing are also automated.

This repository generates disposable_email_blocklist.json from disposable_email_blocklist.conf of disposable-email-domains/disposable-email-domains. You can update the JSON file with the following command.

npm run generate:disposable_email_blocklist_json

After updating the JSON file, please publish the NPM package. To publish, you can push the tag v*.*.* to release the NPM package.

If you want to update the domain list, please make a pull request to disposable-email-domains/disposable-email-domains. When it is reflected in disposable-email-domains/disposable-email-domains, it will also be reflected in this package.

Example Directory

The example/ directory contains sample code in both JavaScript and TypeScript. It serves as:

  • A reference for library consumers (see API usage examples)
  • Integration testing (run with npm run test:example)
  • A check to ensure the example code stays in sync with the main API

License

This project and its data are licensed under CC0 1.0 Universal (public domain dedication).

Ref

About

Provides a JavaScript package to determine if an email domain is disposable, using data from the disposable-email-domains repository.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 6