# addressparser

> Parse e-mail addresses

Latest version **1.0.1** (published 2016-02-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install addressparser
pnpm add addressparser
yarn add addressparser
bun add addressparser
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-02-06 |
| First published | 2012-08-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/addressparser) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 41 |
| Author | Andris Reinman |
| Maintainers | andris |

## Links

- npm: https://www.npmjs.com/package/addressparser
- Repository: https://github.com/andris9/addressparser
- Homepage: https://github.com/andris9/addressparser#readme
- Issues: https://github.com/andris9/addressparser/issues
- npm.io page: https://npm.io/package/addressparser

## Recent versions

- 1.0.1 (latest) — 2016-02-06
- 1.0.0 — 2016-01-11
- 0.3.2 — 2015-01-07
- 0.3.1 — 2014-06-13
- 0.3.0 — 2014-06-13
- 0.2.1 — 2014-02-18
- 0.2.0 — 2013-10-30
- 0.1.3 — 2012-09-24
- 0.1.2 — 2012-09-10
- 0.1.1 — 2012-08-31
- 0.1.0 — 2012-08-30

## README

# addressparser

Parse e-mail address fields. Input can be a single address (`"andris@kreata.ee"`), a formatted address (`"Andris Reinman <andris@kreata.ee>"`), comma separated list of addresses (`"andris@kreata.ee, andris.reinman@kreata.ee"`), an address group (`"disclosed-recipients:andris@kreata.ee;"`) or a mix of all the formats.

In addition to comma the semicolon is treated as the list delimiter as well (except when used in the group syntax), so a value `"andris@kreata.ee; andris.reinman@kreata.ee"` is identical to `"andris@kreata.ee, andris.reinman@kreata.ee"`.

## Installation

Install with npm

```
npm install addressparser
```

## Usage

Include the module

```javascript
var addressparser = require('addressparser');
```

Parse some address strings with `addressparser(field)`

```javascript
var addresses = addressparser('andris <andris@tr.ee>');
console.log(addresses); // [{name: "andris", address:"andris@tr.ee"}]
```

And when using groups

```javascript
addressparser('Composers:"Bach, Sebastian" <sebu@example.com>, mozart@example.com (Mozzie);');
```

the result would be

```
[
    {
        name: "Composers",
        group: [
            {
                address: "sebu@example.com",
                name: "Bach, Sebastian"
            },
            {
                address: "mozart@example.com",
                name: "Mozzie"
            }
        ]
    }
]
```

> Be prepared though that groups might be nested.

## Notes

This module does not decode any mime-word or punycode encoded strings, it is only a basic parser for parsing the base data, you need to decode the encoded parts later by yourself

## License

**MIT**

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