Nitrogen Poisonous Monoxide
Have ideas to improve npm?Join in the discussion! »

address-rfc2822

2.0.6 • Public • Published

Build Status Win 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}`);
console.log(`Email name: ${address.name()}`);
console.log(`Reformatted: ${address.format()}`);
console.log(`User part: ${address.user()}`);
console.log(`Host part: ${address.host()}`);

License

This module is MIT licensed.

Install

npm i address-rfc2822

DownloadsWeekly Downloads

9,459

Version

2.0.6

License

MIT

Unpacked Size

22.3 kB

Total Files

15

Last publish

Collaborators

  • avatar
  • avatar
  • avatar