Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mziyut/disposable-email-domains-js
Provides a JavaScript package to determine if an email domain is disposable, using data from the disposable-email-domains repository.
https://github.com/mziyut/disposable-email-domains-js
disposable-email-domains nodejs npm
Last synced: about 2 months ago
JSON representation
Provides a JavaScript package to determine if an email domain is disposable, using data from the disposable-email-domains repository.
- Host: GitHub
- URL: https://github.com/mziyut/disposable-email-domains-js
- Owner: mziyut
- License: cc0-1.0
- Created: 2024-08-10T06:17:17.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-11-29T15:05:02.000Z (2 months ago)
- Last Synced: 2024-11-29T15:29:56.523Z (2 months ago)
- Topics: disposable-email-domains, nodejs, npm
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/disposable-email-domains-js
- Size: 342 KB
- Stars: 15
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# disposable-email-domains-js
[![NPM](http://img.shields.io/npm/v/disposable-email-domains-js.svg?style=flat-square&label=npm)](https://www.npmjs.com/package/disposable-email-domains-js) [![test](https://github.com/mziyut/disposable-email-domains-js/actions/workflows/test.yml/badge.svg)](https://github.com/mziyut/disposable-email-domains-js/actions/workflows/test.yml) [![CodeQL](https://github.com/mziyut/disposable-email-domains-js/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/mziyut/disposable-email-domains-js/actions/workflows/github-code-scanning/codeql) [![codecov](https://codecov.io/github/mziyut/disposable-email-domains-js/graph/badge.svg?token=3OU2TSQQH6)](https://codecov.io/github/mziyut/disposable-email-domains-js)
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
```js
var disposableEmailDomains = require('disposable-email-domains-js');disposableEmailDomains.isDisposableEmailDomain('example.com'); // return false
disposableEmailDomains.isDisposableEmail('[email protected]'); // return falsedisposableEmailDomains.isDisposableEmailDomain('mailinator.com'); // return true
disposableEmailDomains.isDisposableEmail('[email protected]'); // return true
``````js
import { isDisposableEmail } from 'disposable-email-domains-js';isDisposableEmailDomain('example.com'); // return false
isDisposableEmail('[email protected]'); // return falseisDisposableEmailDomain('mailinator.com'); // return true
isDisposableEmail('[email protected]'); // return true
```## Updating the Domain List
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.
```sh
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.
## Ref
- [disposable-email-domains/disposable-email-domains: a list of disposable and temporary email address domains](https://github.com/disposable-email-domains/disposable-email-domains)
[disposable-email-domains/disposable-email-domains]: https://github.com/disposable-email-domains/disposable-email-domains