address-rfc2822

RFC 2822 & 5322 (Header) email address parser

use @haraka/email-address
Last updated 6 months ago by GitHub Actions .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install address-rfc2822 
SYNC missed versions from official npm registry.

NOTICE, DEPRECATED

This module is superseded by @haraka/email-address. New projects should use @haraka/email-address instead. (ref haraka/Haraka#3564)


Build Status Code Climate Coverage Status

address-rfc2822

Parser for RFC 2822 & 5322 (Header) format email addresses.

This module parses RFC 2822 headers containing addresses such as From, To, CC, and BCC headers.

It is almost a direct port of the perl module Mail::Address and I'm grateful to the original authors of that module for the clean code and the tests.

Installation

npm install address-rfc2822

Usage

const addrparser = require('address-rfc2822')

const addresses = addrparser.parse('Matt Sergeant <helpme+npm@gmail.com>')
const address = addresses[0]

console.log(`Email address: ${address.address}`) // helpme+npm@gmail.com
console.log(`Email name: ${address.name()}`)     // Matt Sergeant
console.log(`Reformatted: ${address.format()}`)  // Matt Sergeant <helpme+npm@gmail.com>
console.log(`User part: ${address.user()}`)      // helpme+npm
console.log(`Host part: ${address.host()}`)      // gmail.com

More Info

License

This module is MIT licensed.

Current Tags

  • 2.2.4                                ...           latest (6 months ago)

18 Versions

  • 2.2.4 [deprecated]           ...           6 months ago
  • 2.2.3 [deprecated]           ...           2 years ago
  • 2.2.2 [deprecated]           ...           3 years ago
  • 2.2.1 [deprecated]           ...           3 years ago
  • 2.2.0 [deprecated]           ...           3 years ago
  • 2.1.0 [deprecated]           ...           6 years ago
  • 2.0.6 [deprecated]           ...           6 years ago
  • 2.0.5 [deprecated]           ...           6 years ago
  • 2.0.4 [deprecated]           ...           8 years ago
  • 2.0.3 [deprecated]           ...           9 years ago
  • 2.0.2 [deprecated]           ...           9 years ago
  • 2.0.1 [deprecated]           ...           9 years ago
  • 2.0.0 [deprecated]           ...           9 years ago
  • 1.0.1 [deprecated]           ...           10 years ago
  • 1.0.0 [deprecated]           ...           11 years ago
  • 0.0.2 [deprecated]           ...           14 years ago
  • 0.0.1 [deprecated]           ...           14 years ago
  • 0.0.0 [deprecated]           ...           14 years ago
Downloads
Total 37
Today 0
This Week 0
This Month 18
Last Day 0
Last Week 0
Last Month 18
Dependencies (1)
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE