Extract unique email addresses out of just about any string!
import emailsInString from "emails-in-string";
const uniqueEmails = emailsInString(`[email protected],
"User at Domain" <[email protected]>, [email protected],
[email protected]`);
// ["[email protected]", "[email protected]", "[email protected]" ]
Enjoy!
A suite of tests can be found in the ./tests directory and can be executed by running npm run test
.