@mikkelscheike/email-provider-links 2.4.0 → 2.5.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/README.md +31 -2
- package/dist/security/hash-verifier.js +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -26,6 +26,20 @@ A TypeScript library providing direct links to **93 email providers** (178 domai
|
|
|
26
26
|
npm install @mikkelscheike/email-provider-links
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
## Requirements
|
|
30
|
+
|
|
31
|
+
- **Node.js**: `>=18.0.0` (Tested on 18.x, 20.x, 22.x, **24.x**)
|
|
32
|
+
- **TypeScript**: `>=4.0.0` (optional)
|
|
33
|
+
- **Zero runtime dependencies** - No external packages required
|
|
34
|
+
|
|
35
|
+
### Node.js 24 Support ✨
|
|
36
|
+
|
|
37
|
+
Fully compatible with the latest Node.js 24.x! The library is tested on:
|
|
38
|
+
- Node.js 18.x (LTS)
|
|
39
|
+
- Node.js 20.x (LTS)
|
|
40
|
+
- Node.js 22.x (Current)
|
|
41
|
+
- **Node.js 24.x (Latest)** - Full support with latest features
|
|
42
|
+
|
|
29
43
|
## Quick Start
|
|
30
44
|
|
|
31
45
|
**One function handles everything** - consumer emails, business domains, and unknown providers:
|
|
@@ -84,8 +98,23 @@ console.log(unknown.loginUrl); // null
|
|
|
84
98
|
**Recommended** - Detects any email provider including business domains.
|
|
85
99
|
|
|
86
100
|
```typescript
|
|
87
|
-
|
|
88
|
-
|
|
101
|
+
// 🚀 SAME CALL, DIFFERENT SCENARIOS:
|
|
102
|
+
|
|
103
|
+
// ✅ For known providers (Gmail, Yahoo, etc.) - INSTANT response
|
|
104
|
+
const gmail1 = await getEmailProvider('user@gmail.com'); // No timeout needed
|
|
105
|
+
const gmail2 = await getEmailProvider('user@gmail.com', 3000); // Same speed - timeout ignored
|
|
106
|
+
// Both return instantly: { provider: "Gmail", loginUrl: "https://mail.google.com/mail/" }
|
|
107
|
+
|
|
108
|
+
// 🔍 For business domains - DNS lookup required, timeout matters
|
|
109
|
+
const biz1 = await getEmailProvider('user@mycompany.com'); // 5000ms timeout (default)
|
|
110
|
+
const biz2 = await getEmailProvider('user@mycompany.com', 2000); // 2000ms timeout (faster fail)
|
|
111
|
+
const biz3 = await getEmailProvider('user@mycompany.com', 10000); // 10000ms timeout (slower networks)
|
|
112
|
+
// All may detect: { provider: "Google Workspace", detectionMethod: "mx_record" }
|
|
113
|
+
|
|
114
|
+
// 🎯 WHY USE CUSTOM TIMEOUT?
|
|
115
|
+
// - Faster apps: Use 2000ms to fail fast on unknown domains
|
|
116
|
+
// - Slower networks: Use 10000ms to avoid premature timeouts
|
|
117
|
+
// - Enterprise: Use 1000ms for strict SLA requirements
|
|
89
118
|
```
|
|
90
119
|
|
|
91
120
|
### `getEmailProviderSync(email)`
|
|
@@ -29,7 +29,7 @@ const KNOWN_GOOD_HASHES = {
|
|
|
29
29
|
// SHA-256 hash of the legitimate emailproviders.json
|
|
30
30
|
'emailproviders.json': 'f77814bf0537019c6f38bf2744ae21640f04a2d39cb67c5116f6e03160c9486f',
|
|
31
31
|
// You can add hashes for other critical files
|
|
32
|
-
'package.json': '
|
|
32
|
+
'package.json': '6facf7082675511a8938fc7ae69f03cf9610103c410febbf514381373a0946be'
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
35
|
* Calculates SHA-256 hash of a file or string content
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikkelscheike/email-provider-links",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "TypeScript library for email provider detection with 93 providers (178 domains), concurrent DNS resolution, optimized performance, 91.75% test coverage, and enterprise security for login and password reset flows",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -53,6 +53,10 @@
|
|
|
53
53
|
"bugs": {
|
|
54
54
|
"url": "https://github.com/mikkelscheike/email-provider-links/issues"
|
|
55
55
|
},
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=18.0.0",
|
|
58
|
+
"comment": "Supports Node.js 18.x, 20.x, 22.x, and 24.x"
|
|
59
|
+
},
|
|
56
60
|
"publishConfig": {
|
|
57
61
|
"access": "public"
|
|
58
62
|
},
|