-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmailfaker.js
More file actions
278 lines (264 loc) · 15.7 KB
/
Copy pathmailfaker.js
File metadata and controls
278 lines (264 loc) · 15.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
(function(global) {
function MailFaker(locale) {
this.locale = (typeof locale === 'string' && locales[locale]) ? locale : 'en';
this.data = locales[this.locale];
}
MailFaker.version = '1.1.0';
MailFaker.prototype._randomItem = function(arr) {
return arr[Math.floor(Math.random() * arr.length)];
};
MailFaker.prototype.firstName = function(gender) {
if (gender === 'female') return this._randomItem(this.data.firstNames.female);
if (gender === 'male') return this._randomItem(this.data.firstNames.male);
return this._randomItem(this._randomItem([this.data.firstNames.female, this.data.firstNames.male]));
};
MailFaker.prototype.lastName = function() {
return this._randomItem(this.data.lastNames);
};
MailFaker.prototype.fullName = function(gender) {
return this.firstName(gender) + ' ' + this.lastName();
};
MailFaker.prototype.localPart = function(gender) {
var fn = this.firstName(gender).toLowerCase();
var ln = this.lastName().toLowerCase();
var sep = ['.', '-', '_'][Math.floor(Math.random() * 3)];
var num = Math.floor(Math.random() * 9000 + 1000);
var namePart = fn + sep + ln;
var reverse = Math.random() < 0.5;
return reverse ? num + sep + namePart : namePart + sep + num;
};
MailFaker.prototype.domainPart = function() {
var domain = this._randomItem(this.data.domains);
var tld = this._randomItem(globalTlds);
return domain + '.' + tld;
};
MailFaker.prototype.fullAddress = function(gender) {
return this.localPart(gender) + '@' + this.domainPart();
};
var locales = {
en: {
firstNames: {
male: [
'John', 'Markus', 'Peter', 'David', 'Robert',
'James', 'William', 'Michael', 'Richard', 'Joseph',
'Charles', 'Thomas', 'Christopher', 'Daniel', 'Matthew',
'Anthony', 'Donald', 'Paul', 'George', 'Steven',
'Edward', 'Brian', 'Ronald', 'Kevin', 'Jason',
'Jeffrey', 'Ryan', 'Jacob', 'Gary', 'Nicholas',
'Eric', 'Stephen', 'Jonathan', 'Larry', 'Justin',
'Scott', 'Brandon', 'Benjamin', 'Samuel', 'Frank',
'Gregory', 'Raymond', 'Alexander', 'Patrick', 'Jack',
'Dennis', 'Jerry', 'Tyler', 'Aaron', 'Adam'
],
female: [
'Lisa', 'Manuela', 'Sabine', 'Anna', 'Julia',
'Mary', 'Patricia', 'Jennifer', 'Linda', 'Elizabeth',
'Barbara', 'Susan', 'Jessica', 'Sarah', 'Karen',
'Nancy', 'Margaret', 'Lisa', 'Betty', 'Dorothy',
'Sandra', 'Ashley', 'Kimberly', 'Donna', 'Emily',
'Michelle', 'Carol', 'Amanda', 'Melissa', 'Deborah',
'Stephanie', 'Rebecca', 'Laura', 'Sharon', 'Cynthia',
'Kathleen', 'Amy', 'Shirley', 'Angela', 'Helen',
'Anna', 'Brenda', 'Pamela', 'Nicole', 'Emma',
'Samantha', 'Katherine', 'Christine', 'Debra', 'Rachel'
]
},
lastNames: [
'Miller', 'Smith', 'Johnson', 'Williams', 'Brown',
'Jones', 'Garcia', 'Davis', 'Rodriguez', 'Martinez',
'Hernandez', 'Lopez', 'Gonzalez', 'Wilson', 'Anderson',
'Thomas', 'Taylor', 'Moore', 'Jackson', 'Martin',
'Lee', 'Perez', 'Thompson', 'White', 'Harris',
'Sanchez', 'Clark', 'Ramirez', 'Lewis', 'Robinson',
'Walker', 'Young', 'Allen', 'King', 'Wright',
'Scott', 'Torres', 'Nguyen', 'Hill', 'Flores',
'Green', 'Adams', 'Nelson', 'Baker', 'Hall',
'Rivera', 'Campbell', 'Mitchell', 'Carter', 'Roberts',
'Gomez', 'Phillips', 'Evans', 'Turner', 'Diaz',
'Parker', 'Cruz', 'Edwards', 'Collins', 'Reyes',
'Stewart', 'Morris', 'Morales', 'Murphy', 'Cook',
'Rogers', 'Gutierrez', 'Ortiz', 'Morgan', 'Cooper',
'Peterson', 'Bailey', 'Reed', 'Kelly', 'Howard',
'Ramos', 'Kim', 'Cox', 'Ward', 'Richardson',
'Watson', 'Brooks', 'Chavez', 'Wood', 'James',
'Bennett', 'Gray', 'Mendoza', 'Ruiz', 'Hughes',
'Price', 'Alvarez', 'Castillo', 'Sanders', 'Patel',
'Myers', 'Long', 'Ross', 'Foster', 'Jimenez'
],
domains: [
'mailflare', 'netstream', 'inboxcore', 'postbridge', 'cloudsend',
'fastmailer', 'msgnetic', 'mailhub', 'infonex', 'digitpost',
'swiftconnect', 'netlance', 'mailbolt', 'zapmail', 'postgrid',
'linkinbox', 'mailburst', 'datahatch', 'webpostix', 'mailflux',
'postnova', 'sendloop', 'mailrange', 'cloudcrate', 'messario',
'netpillar', 'postnest', 'skyinbox', 'streamsend', 'inboxwave',
'dashmail', 'mailtide', 'zipconnect', 'airpostix', 'bytecourier',
'netrelay', 'cloudflick', 'postnestor', 'senddome', 'mailium',
'quanticmail', 'mailgator', 'fusepost', 'letterlab', 'coremail',
'inboxport', 'vortexsend', 'msgcrate', 'maildrive', 'datapouch',
'pingletter', 'maildock', 'postdrift', 'flashsender', 'postcore',
'pushmailr', 'mailbitz', 'nexletter', 'inpostly', 'postlex',
'netboxy', 'mailrise', 'delivernet', 'packetmail', 'airmailer',
'sendpilgrim', 'poboxly', 'mailorama', 'webcourier', 'netmessenger',
'flowmailr', 'jumpboxx', 'quikpost', 'mailtap', 'mailnutra',
'boxpostr', 'mailcrate', 'inboxor', 'postflare', 'trumailr',
'mailnova', 'messalink', 'sendgridz', 'rapidletter', 'inboxberry',
'mailnest', 'zipmailer', 'trustinbox', 'cloudmailly', 'mailjump',
'textorama', 'mailswirl', 'clickcourier', 'ultramailr', 'byteinbox',
'packpost', 'mailbay', 'quicksendr', 'infopostix', 'netpigeon'
]
},
de: {
firstNames: {
male: [
'Benedikt', 'Lukas', 'Thomas', 'Andreas', 'Johannes',
'Felix', 'Paul', 'Leon', 'Maximilian', 'Julian',
'Moritz', 'Tim', 'Philipp', 'Daniel', 'Sebastian',
'Simon', 'David', 'Fabian', 'Tobias', 'Jan',
'Niklas', 'Noah', 'Matthias', 'Benjamin', 'Florian',
'Marcel', 'Erik', 'Nico', 'Jakob', 'Christian',
'Alexander', 'Oliver', 'Dominik', 'Patrick', 'Marco',
'Stefan', 'Kevin', 'Rafael', 'Jannis', 'Henrik',
'Michael', 'Elias', 'Emil', 'Karl', 'Till',
'Hannes', 'Luis', 'Jonas', 'Ruben', 'Malte'
],
female: [
'Anabel', 'Nisa', 'Sabine', 'Gabi', 'Lisa',
'Julia', 'Anna', 'Lena', 'Laura', 'Marie',
'Sophie', 'Lea', 'Katharina', 'Sarah', 'Johanna',
'Clara', 'Nina', 'Mara', 'Alina', 'Franziska',
'Miriam', 'Eva', 'Antonia', 'Carolin', 'Melanie',
'Vanessa', 'Theresa', 'Luisa', 'Helena', 'Paula',
'Elena', 'Isabel', 'Charlotte', 'Annika', 'Linda',
'Jana', 'Selina', 'Tanja', 'Kristin', 'Ines',
'Monika', 'Martina', 'Stefanie', 'Angelina', 'Nadine',
'Rebecca', 'Verena', 'Sandra', 'Birgit', 'Amelie'
]
},
lastNames: [
'Mueller', 'Meier', 'Schmidt', 'Schneider', 'Fischer',
'Weber', 'Meyer', 'Wagner', 'Becker', 'Hoffmann',
'Schulz', 'Koch', 'Bauer', 'Richter', 'Klein',
'Wolf', 'Schroeder', 'Neumann', 'Schwarz', 'Zimmermann',
'Braun', 'Krueger', 'Hofmann', 'Hartmann', 'Lange',
'Schmitt', 'Werner', 'Krause', 'Zimmer', 'Walter',
'Peters', 'Lang', 'Scholz', 'Mayer', 'Baumann',
'Franke', 'Albrecht', 'Berger', 'Boehm', 'Kuehn',
'Jung', 'Keller', 'Seidel', 'Graf', 'Winter',
'Brandt', 'Heinrich', 'Hahn', 'Voigt', 'Busch',
'Kuhn', 'Simon', 'Arnold', 'Lorenz', 'Otto',
'Schreiber', 'Martin', 'Schulte', 'Reuter', 'Gross',
'Dietrich', 'Ziegler', 'Friedrich', 'Schuster', 'Binder',
'Kretschmer', 'Linke', 'Hauser', 'Horn', 'Barth',
'Wendt', 'Engel', 'Eckert', 'Pfeiffer', 'Ludwig',
'Bergmann', 'Voelker', 'Merkel', 'Rose', 'Weiss',
'Mohr', 'Kaiser', 'Franz', 'Vogel', 'Adam',
'Henkel', 'Stark', 'Bock', 'Koenig', 'Reinhardt',
'Uhlig', 'Jakob', 'Heinz', 'Wolff', 'Roemer',
'Tillmann', 'Gebhardt', 'Naumann', 'Urban', 'Geiger'
],
domains: [
'nachrichtenbox', 'webnachricht', 'maildienst', 'schnellmail', 'postinfo',
'kontaktservice', 'mailportal', 'datenkurier', 'emailcenter', 'briefcloud',
'netznachricht', 'inboxdienst', 'nachrichtwerk', 'kontaktnetz', 'webzustellung',
'nachrichtlich', 'postversand', 'digitalpost', 'kontaktjetzt', 'schnellkontakt',
'mailverbindung', 'webpostfach', 'mailklick', 'kontaktpost', 'datenpost',
'nachrichtkompakt', 'postverbindung', 'infonachricht', 'kontaktmail', 'mailkontakt',
'direktnachricht', 'sicheremail', 'kontaktbox', 'postzugang', 'nachrichtpunkt',
'emailnetz', 'onlinemailbox', 'kontaktflink', 'digitalkontakt', 'kontaktjet',
'einfachmail', 'servicekontakt', 'zustellnetz', 'webmailprofi', 'inboxplus',
'nachrichtsmart', 'datennachricht', 'mailboten', 'kontaktmanager', 'zustelldienst',
'postkontakt', 'emailpaket', 'mailablage', 'kontaktinsel', 'briefnetz',
'smartkontakt', 'schnellversand', 'kontaktportal', 'netzbrief', 'emaildock',
'zustellfix', 'kontaktaktiv', 'infonetzmail', 'mailconnect', 'kontaktone',
'postkanal', 'mailflow', 'versandkontakt', 'inboxkraft', 'kontaktzone',
'nachrichtsafe', 'emailunion', 'kontaktlink', 'postalpha', 'kontaktomat',
'netzpostfach', 'briefconnect', 'sicherzustellung', 'emailpartner', 'kontaktcloud',
'nachrichtplus', 'postbridge', 'mailpark', 'kontaktwerk', 'emailpilot',
'infopostdienst', 'kontaktcenter', 'nachrichtmax', 'mailstation', 'kontaktunion',
'briefservice', 'datenzusteller', 'netzmailbox', 'kontaktwerkstatt', 'poststart',
'nachrichtportal', 'mailstation24', 'schnellzugang', 'kontaktbase', 'emailservicebox'
]
},
fr: {
firstNames: {
male: [
'Jean', 'Luc', 'Marc', 'Thierry', 'Pierre',
'Michel', 'Alain', 'Andre', 'Louis', 'Francois',
'Paul', 'Henri', 'Jacques', 'Claude', 'Gerard',
'Bernard', 'Pascal', 'Raymond', 'Christian', 'Didier',
'Antoine', 'Eric', 'Laurent', 'Julien', 'Nicolas',
'Maxime', 'Hugo', 'Sebastien', 'Olivier', 'Damien',
'Romain', 'Christophe', 'Florian', 'Philippe', 'Yann',
'Gabriel', 'Loic', 'Tristan', 'Arnaud', 'Mathieu',
'Benoit', 'Remi', 'Gael', 'Thibault', 'Alexandre',
'Quentin', 'Victor', 'Jules', 'Lucas', 'Cedric'
],
female: [
'Marie', 'Nathalie', 'Chloe', 'Sophie', 'Claire',
'Isabelle', 'Catherine', 'Camille', 'Julie', 'Emilie',
'Helene', 'Anne', 'Valerie', 'Sandrine', 'Amandine',
'Christine', 'Elodie', 'Charlotte', 'Amelie', 'Lucie',
'Laetitia', 'Ines', 'Manon', 'Audrey', 'Noemie',
'Florence', 'Madeleine', 'Colette', 'Jacqueline', 'Aurelie',
'Veronique', 'Justine', 'Sarah', 'Delphine', 'Myriam',
'Lea', 'Adele', 'Clemence', 'Maelle', 'Alice',
'Jeanne', 'Mathilde', 'Cecile', 'Anais', 'Melanie',
'Caroline', 'Brigitte', 'Genevieve', 'Josephine', 'Eva'
]
},
lastNames: [
'Dubois', 'Lefevre', 'Moreau', 'Laurent', 'Martin',
'Bernard', 'Thomas', 'Petit', 'Robert', 'Richard',
'Durand', 'Leroy', 'Roux', 'David', 'Bertrand',
'Morel', 'Fournier', 'Girard', 'Bonnet', 'Dupont',
'Lambert', 'Fontaine', 'Rousseau', 'Vincent', 'Muller',
'Lemoine', 'Faure', 'Andre', 'Mercier', 'Blanc',
'Guerin', 'Meyer', 'Marchand', 'Leclerc', 'Renaud',
'Barbier', 'Perrin', 'Mathieu', 'Garnier', 'Chevalier',
'Aubry', 'Renard', 'Charpentier', 'Roy', 'Clement',
'Noel', 'Gauthier', 'Lopez', 'Baron', 'Mallet',
'Brun', 'Henry', 'Chauvet', 'Pascal', 'Paris',
'Jacob', 'Rolland', 'Adam', 'Benoit', 'Carre',
'Delorme', 'Gilles', 'Perrot', 'Vallet', 'Lucas',
'Collet', 'Bailly', 'Leger', 'Besson', 'Hardy',
'Gilbert', 'Legrand', 'Masson', 'Navarro', 'Descamps',
'Dumas', 'Pires', 'Rey', 'Verdier', 'Poirier',
'Pichon', 'Raynaud', 'Cordier', 'Royer', 'Pelletier',
'Blanchard', 'Lemoigne', 'Pasquier', 'Jacquet', 'Giraud',
'Bourgeois', 'Morin', 'Chapel', 'Devaux', 'Thibault',
'Hebert', 'Vasseur', 'Caron', 'Maillard', 'Picard'
],
domains: [
'mailvitesse', 'netcourri', 'postalis', 'francomail', 'courrivo',
'telepost', 'mailoria', 'zonemail', 'courrielux', 'netpostal',
'rapidemail', 'courrimail', 'frboxnet', 'numeriposte', 'eclairmail',
'cibox', 'mailtic', 'courrieria', 'postanetix', 'messalia',
'fournix', 'courriserve', 'infomess', 'lettromail', 'maileva',
'cyberposte', 'messagor', 'serviposte', 'digitmail', 'courrios',
'telecour', 'mailoque', 'courrisoft', 'mailique', 'frconnectix',
'courrigo', 'mailvia', 'postyl', 'courrionet', 'rapidonet',
'evomail', 'courriora', 'infrapost', 'proxinetmail', 'netmailis',
'courrimax', 'linkoposte', 'messaflux', 'courrily', 'datamailix',
'teleboxis', 'postanova', 'mailative', 'courricom', 'francoposte',
'mailifique', 'courrinetix', 'fastcour', 'mailqube', 'postarena',
'courrigen', 'mailvert', 'numerilink', 'postelio', 'mailcorex',
'courrixis', 'velomail', 'quantiposte', 'courrisonic', 'weboposte',
'mailnest', 'postably', 'courrizer', 'mailova', 'boximail',
'postoria', 'courrialis', 'mailance', 'courringo', 'netomail',
'mailnova', 'courrisoft', 'mailuno', 'posteoze', 'mailorion',
'courriblue', 'veloposte', 'quickcourri', 'cybercour', 'courrino',
'mailspace', 'courrovia', 'postelys', 'courrinet', 'mailtique',
'courrizen', 'mailfluxis', 'servimail', 'courrident', 'datapostix'
]
}
};
// Global TLDs (used across all locales)
var globalTlds = ['com', 'net', 'org', 'info', 'biz', 'io', 'co', 'xyz', 'online', 'site'];
// Export
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = MailFaker;
} else {
global.MailFaker = MailFaker;
}
})(this);