# get-emails

> Get all email addresses in a string

Latest version **5.0.0** (published 2026-02-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-emails
pnpm add get-emails
yarn add get-emails
bun add get-emails
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2026-02-02 |
| First published | 2014-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 1 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 61 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | get, extract, find, scrape, text, string, email, address, emails |

## Links

- npm: https://www.npmjs.com/package/get-emails
- Repository: https://github.com/sindresorhus/get-emails
- Homepage: https://github.com/sindresorhus/get-emails#readme
- Issues: https://github.com/sindresorhus/get-emails/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/get-emails

## Dependencies (1)

- [email-regex](https://npm.io/package/email-regex.md) ^6.1.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 5.0.0 (latest) — 2026-02-02
- 4.0.0 — 2021-09-10
- 3.0.0 — 2019-04-15
- 2.1.0 — 2017-11-08
- 2.0.0 — 2017-01-21
- 1.0.1 — 2015-02-16
- 1.0.0 — 2014-09-07

## README

# get-emails

> Get all email addresses in a string

## Install

```sh
npm install get-emails
```

## Usage

```js
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

- [get-emails-cli](https://github.com/sindresorhus/get-emails-cli) - CLI for this module

---
_Source: https://npm.io/package/get-emails · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
