disposable-domains 1.0.15 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +50 -0
- package/LICENSE +22 -0
- package/README.md +39 -29
- package/index.json +2128 -391
- package/package.json +3 -3
- package/scripts/domain-manager.js +44 -114
- package/test/index.js +0 -4
- package/scripts/release.js +0 -164
- package/test/helpers/notInWildcard.js +0 -20
- package/test/wildcard.js +0 -29
- package/wildcard.js +0 -6
- package/wildcard.json +0 -554
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
id-token: write
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
|
|
19
|
+
- uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: 20
|
|
22
|
+
registry-url: https://registry.npmjs.org
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: npm ci
|
|
26
|
+
|
|
27
|
+
- name: Process domain lists (includes tests)
|
|
28
|
+
run: npm run process
|
|
29
|
+
|
|
30
|
+
- name: Ensure repo is clean after processing
|
|
31
|
+
run: |
|
|
32
|
+
if ! git diff --quiet; then
|
|
33
|
+
echo "Repository not clean after running npm run process. Please commit generated changes before tagging."
|
|
34
|
+
git diff --stat
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
- name: Ensure tag matches package.json version
|
|
39
|
+
run: |
|
|
40
|
+
TAG_VERSION="${GITHUB_REF_NAME#v}"
|
|
41
|
+
PKG_VERSION=$(node -p "require('./package.json').version")
|
|
42
|
+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
|
|
43
|
+
echo "Tag version ($TAG_VERSION) does not match package.json version ($PKG_VERSION)"
|
|
44
|
+
exit 1
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
- name: Publish to npm
|
|
48
|
+
env:
|
|
49
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
50
|
+
run: npm publish --provenance
|
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Ilya Volodarsky
|
|
4
|
+
Copyright (c) 2025 Thomas Petracco
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,46 +1,64 @@
|
|
|
1
1
|
# Disposable Email Domains
|
|
2
2
|
|
|
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.
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install disposable-domains
|
|
9
|
+
```
|
|
5
10
|
|
|
6
|
-
##
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
This package exports an array of domains. You can check if an email domain exists in the list:
|
|
7
14
|
|
|
8
|
-
### Node.JS
|
|
9
15
|
```js
|
|
10
|
-
|
|
11
|
-
|
|
16
|
+
const disposableDomains = require('disposable-domains');
|
|
17
|
+
const emailDomain = 'something.mailinator.com';
|
|
12
18
|
|
|
13
|
-
//
|
|
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
|
+
);
|
|
15
23
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
$ npm install disposable-domains
|
|
24
|
+
if (isDisposable) {
|
|
25
|
+
console.log('Blocked.');
|
|
26
|
+
}
|
|
20
27
|
```
|
|
21
28
|
|
|
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
|
+
|
|
22
38
|
## Contributing
|
|
23
39
|
|
|
24
40
|
1. Install dependencies:
|
|
25
|
-
|
|
41
|
+
|
|
42
|
+
```bash
|
|
26
43
|
npm install
|
|
27
44
|
```
|
|
28
45
|
|
|
29
|
-
2. Add
|
|
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
|
|
30
49
|
|
|
31
|
-
3.
|
|
32
|
-
|
|
50
|
+
3. Build the list:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
33
53
|
npm run process
|
|
34
54
|
```
|
|
35
|
-
|
|
36
|
-
|
|
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.
|
|
41
57
|
|
|
42
58
|
## License
|
|
43
59
|
|
|
60
|
+
MIT — see [LICENSE](LICENSE) for details.
|
|
61
|
+
|
|
44
62
|
```
|
|
45
63
|
WWWWWW||WWWWWW
|
|
46
64
|
W W W||W W W
|
|
@@ -53,11 +71,3 @@ WWWWWW||WWWWWW
|
|
|
53
71
|
_||_|| _||_||
|
|
54
72
|
(__|__|(__|__|
|
|
55
73
|
```
|
|
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.
|