# email-address

> Various helper functions and regexes for handling email addresses

Latest version **1.2.2** (published 2015-02-13) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2015-02-13 |
| First published | 2014-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | e-conomic |
| Maintainers | gausby |
| Keywords | email |

## Links

- npm: https://www.npmjs.com/package/email-address
- Repository: https://github.com/e-conomic/email-address
- Issues: https://github.com/e-conomic/email-address/issues
- npm.io page: https://npm.io/package/email-address

## 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.2.2 (latest) — 2015-02-13
- 1.2.1 — 2014-10-07

## README

# Email address helpers [![Build Status](https://travis-ci.org/e-conomic/email-address.svg?branch=master)](https://travis-ci.org/e-conomic/email-address)

Regular expressions ensuring the given input is a valid address.

This module ensure that we use the same approach for validating a given email address across all our services. It was originally lifted from the debitoor-app *source/util*-folder into its own module.


## Overview

### Helper functions
Two helper functions, `isValid` and `isMultipleValid`, are exposed. `isValid` is basically a wrapper calling `.single.test` from the regex section on the input, and `isMultipleValid` splits a string on commas (,), and verify that every item is a valid email address.

Usage:
```js
var email = require('email-address');
email.isValid('joe@example.com'); // true
email.isValid('foo bar'); // false
email.isMultipleValid('john.doe@example.com,jane.doe@example.com'); // true
email.isMultipleValid('john.doe@example.com,jane.doe@example..com'); // false
```

### Regexes
The following regexes are exposed:

  * `.single` the string is a valid email address.
  * `.multiple` the string is a comma seperated list of valid email addresses. Whitespace are allowed between the email addresses.
  * `.optional` the string is a valid email address or an empty string.

Usage:
```js
var email = require('email-address');

// input is a vaild email address
email.single.test('joe@example.com'); // true

// input is a comma seperated list of valid email addresses
email.multiple.test('joe@example.com, jane@example.com'); // true

// input is a valid email address, or an empty string
email.optional.test('jane@example.com'); // true
email.optional.test(''); // true
```

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