Faker.js - generate massive amounts of fake data in the browser and Node.js
github.com
github.com
I'm gently disturbed that it generates valid email addresses. You pick a random name, follow it with an @, then add a random word, and then add a TLD. Obviously you're not responsible for how people use the tool.
Best practice would be to use the domain example.com
Unfortunately, spammers do have way more advanced technologies to try and guess working addresses. Libraries like this generate mostly very improbable addresses: you would get way better results just by taking lists of most popular first names and family names and concatenating them with some well-known web mail providers.
The bigger problem, in my experience, is when you accidentally spam people yourself, while testing some function that somehow generates an outgoing email. I think almost everybody that's ever worked on code that sends emails has - at one time or another - ran a job that somehow wound up sending 6,712,374 "test" messages to every user in the production database. :-) Dummy addresses are better, but it's better still if they use @example.com so you know there's no way they'll actually get delivered to anybody.
Address
|-> US
|-> state
|-> UK
|-> state
An alternative would be for country-specific generators to take a country code as an argument. I am not an experienced API designer, though, so take my comments with a heaping of salt.Need to update to 2.10 soon :)