# email-address-util

> Utilities for working with email addresses

Latest version **1.0.0** (published 2019-11-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install email-address-util
pnpm add email-address-util
yarn add email-address-util
bun add email-address-util
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-11-20 |
| First published | 2019-11-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 23 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ajay Gandhi |
| Maintainers | ajaygandhi |
| Keywords | email, validate, extract, address, utility |

## Links

- npm: https://www.npmjs.com/package/email-address-util
- Repository: https://github.com/ajay-gandhi/email-util
- Homepage: https://github.com/ajay-gandhi/email-util#readme
- Issues: https://github.com/ajay-gandhi/email-util/issues
- npm.io page: https://npm.io/package/email-address-util

## 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

- 1.0.0 (latest) — 2019-11-20

## README

# email-address-util

> Utilities for working with email addresses

## Usage

```bash
# Install the package
npm install email-address-util
```

```js
# Require it in your JS file
const EmailUtil = require("email-address-util");
```

## Validate

Validate that the given string is a valid email address. This method uses the
[regular expression from W3](https://www.w3.org/TR/html5/sec-forms.html#valid-e-mail-address),
then validates the domain against IANA's list of valid TLDs.

```js
EmailUtil.validate("valid@example.com")    # => true
EmailUtil.validate("in(valid@example.com") # => false
```

## Extract

Extract the first email address found in the given string. Uses the same regular
expression as `validate`.

```js
const strWithEmail    = "My email address is jeff@jeff.com";
const strWithoutEmail = "My email address is above";
EmailUtil.extract(strWithEmail)   # => "jeff@jeff.com"
EmailUtil.extract(strWithoutEmai) # => false
```

## Tests

Run tests with `npm test`.

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