Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

address-rfc2822

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

address-rfc2822

RFC 2822 & 5322 (Header) email address parser

  • 2.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.5K
decreased by-3.65%
Maintainers
3
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 29 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc