get-emails
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

get-emails

Get all email addresses in a string

Install

$ npm install get-emails

Usage

import getEmails from 'get-emails';

const text = 'Lorem ipsum dolor, sindresorhus@gmail.com consectetuer unicorn@rainbow.cake elit.';

getEmails(text);
//=> Set {'sindresorhus@gmail.com', 'unicorn@rainbow.cake'}

If the string comes from user input, it's up to you to limit it to some reasonable length to prevent abuse.

Related

Package Sidebar

Install

npm i get-emails

Weekly Downloads

1,874

Version

4.0.0

License

MIT

Unpacked Size

2.98 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus