Socket
Socket
Sign inDemoInstall

addressparser

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    addressparser

Parse e-mail addresses


Version published
Weekly downloads
421K
decreased by-0.28%
Maintainers
1
Install size
11.7 kB
Created
Weekly downloads
 

Readme

Source

addressparser

Parse e-mail address fields

Installation

Install with npm

npm install addressparser

Usage

Include the module

var addressparser = require("addressparser");

Parse some address strings with addressparser(field)

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

Even complex address fields are supported

addressparser('"Bach, Sebastian" <sebu@example.com>, mozart@example.com (Mozzie)');
// [{name: "Bach, Sebastian", address: "sebu@example.com"},
//  {name: "Mozzie", address: "mozart@example.com"}]

addressparser("Music Group: sebu@example.com, mozart@example.com;");
// [{name: "Music Group", address: "sebu@example.com"},
//  {name: "Music Group", address: "mozart@example.com"}]

Notes

  • NB! 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

FAQs

Last updated on 24 Sep 2012

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc