Skip to content

Commit 1c10196

Browse files
authored
Remove wildcard.json (#15)
1 parent 4603720 commit 1c10196

File tree

9 files changed

+84
-1265
lines changed

9 files changed

+84
-1265
lines changed

README.md

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,64 @@
11
# Disposable Email Domains
22

3+
A list of [disposable email domains](http://en.wikipedia.org/wiki/Disposable_email_address) (like `mailinator.com`) commonly used to create temporary accounts. Use this list to detect or block fake accounts during your signup process.
34

4-
A list of [disposable email domains](http://en.wikipedia.org/wiki/Disposable_email_address) 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](https://github.com/tompec/disposable-email-domains/blob/main/index.json) and wildcard domains (ex: `*.33mail.com`) are in [wildcard.json](https://github.com/tompec/disposable-email-domains/blob/main/wildcard.json).
5+
## Installation
6+
7+
```bash
8+
npm install disposable-domains
9+
```
510

6-
## Examples
11+
## Usage
12+
13+
This package exports an array of domains. You can check if an email domain exists in the list:
714

8-
### Node.JS
915
```js
10-
var domains = require('disposable-domains');
11-
var wildcards = require('disposable-domains/wildcard.json');
16+
const disposableDomains = require('disposable-domains');
17+
const emailDomain = 'something.mailinator.com';
1218

13-
// ... your code here
14-
```
19+
// Check if the exact domain OR the root domain is in the list
20+
const isDisposable = disposableDomains.some(domain =>
21+
emailDomain === domain || emailDomain.endsWith('.' + domain)
22+
);
1523

16-
## Installation
17-
18-
```
19-
$ npm install disposable-domains
24+
if (isDisposable) {
25+
console.log('Blocked.');
26+
}
2027
```
2128

29+
### How the list works
30+
31+
The entries in `index.json` should be treated as **domain suffixes**.
32+
33+
This means you should block the exact domain match **and** any subdomain to the left of it (a recursive wildcard match).
34+
35+
- **Matches:** `mailinator.com`
36+
- **Also Matches:** `sub.mailinator.com`, `a.b.mailinator.com`
37+
2238
## Contributing
2339

2440
1. Install dependencies:
25-
```
41+
42+
```bash
2643
npm install
2744
```
2845

29-
2. Add your disposable domains to [contributions/index.txt](https://github.com/tompec/disposable-email-domains/blob/main/contributions/index.txt) (one domain per line, without any additional formatting)
46+
2. Add domains to [contributions/index.txt](https://github.com/tompec/disposable-email-domains/blob/main/contributions/index.txt):
47+
- One domain per line
48+
- No extra formatting
3049

31-
3. Run the [domain manager script](https://github.com/tompec/disposable-email-domains/blob/main/scripts/domain-manager.js):
32-
```
50+
3. Build the list:
51+
52+
```bash
3353
npm run process
3454
```
35-
That script will:
36-
- Add your domains to index.json
37-
- Validate domains using the FQDN (Fully Qualified Domain Name) standard
38-
- Move domains to wildcard.json if they have 2 or more subdomains
39-
- Sort and deduplicate all entries
40-
- Run the tests to ensure everything is working correctly
55+
56+
This validates, sorts, and deduplicates your entries.
4157

4258
## License
4359

60+
MIT — see [LICENSE](LICENSE) for details.
61+
4462
```
4563
WWWWWW||WWWWWW
4664
W W W||W W W
@@ -53,11 +71,3 @@ WWWWWW||WWWWWW
5371
_||_|| _||_||
5472
(__|__|(__|__|
5573
```
56-
57-
THE SOFTWARE IS PROVIDED "AS IS" AND "AS AND WHEN AVAILABLE", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
58-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
59-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
60-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
61-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
62-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
63-
THE SOFTWARE.

0 commit comments

Comments
 (0)