What is disposable-email-domains?
The disposable-email-domains npm package provides a list of domains that are known to be used for disposable email addresses. This can be useful for filtering out temporary or throwaway email addresses in your applications.
What are disposable-email-domains's main functionalities?
Check if a domain is disposable
This feature allows you to check if a given email address belongs to a disposable email domain. The code sample demonstrates how to split the email to get the domain and check if it is in the list of disposable domains.
const disposableDomains = require('disposable-email-domains');
function isDisposableEmail(email) {
const domain = email.split('@')[1];
return disposableDomains.includes(domain);
}
console.log(isDisposableEmail('test@mailinator.com')); // true
console.log(isDisposableEmail('test@gmail.com')); // false
Get the list of disposable domains
This feature allows you to access the entire list of disposable email domains. The code sample demonstrates how to require the package and log the list of domains.
const disposableDomains = require('disposable-email-domains');
console.log(disposableDomains);
Other packages similar to disposable-email-domains
disposable-email
The disposable-email package provides similar functionality by offering a list of disposable email domains and a function to check if an email is disposable. It also includes additional features like updating the list of domains from a remote source.
email-verifier
The email-verifier package offers more comprehensive email validation, including checking for disposable email addresses, verifying the email format, and checking the existence of the email domain. It provides a broader range of email verification features compared to disposable-email-domains.
is-disposable-email
The is-disposable-email package focuses on checking if an email address is disposable. It provides a simple API to check if an email is from a disposable domain, similar to disposable-email-domains, but with a different implementation.
disposable-email-domains
A list of disposable email domains like mailinator.com
. You can use it to detect or block disposable accounts in your signup process. Exact domain matches are found in index.json and wildcard domains (ex: *.33mail.com
) are in wildcard.json.
Examples
Node.JS
var domains = require('disposable-email-domains');
var wildcards = require('disposable-email-domains/wildcard.json');
API
An always-up-to-date version of this repo is provided as an API by Kickbox. Issuing a GET
request to https://open.kickbox.com/v1/disposable/{DomainOrEmailAddress} will return {"disposable":true}
or {"disposable":false}
as a JSON response.
https://open.kickbox.com/v1/disposable/mailinator.com
{"disposable":true}
Installation
$ npm install disposable-email-domains
$ component install ivolo/disposable-email-domains
Contributing
Add new disposable domains to index.json and wildcard disposable domains to wildcard.json.
To easily add new domains, insert them into index.txt and/or wildcard.txt and run npm run add
.
The domains will be added to the respective files and some validation will be made to ensure they pass the tests.
Please run npm run test
before creating a Pull Request to ensure all tests are passing.
You can also run npm run prod
to add new domains and run the tests at the same time.
License
WWWWWW||WWWWWW
W W W||W W W
||
( OO )__________
/ | \
/o o| MIT \
\___/||_||__||_|| *
|| || || ||
_||_|| _||_||
(__|__|(__|__|
THE SOFTWARE IS PROVIDED "AS IS" AND "AS AND WHEN AVAILABLE", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.