Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haraka/node-address-rfc2822
Parser for RFC2822 (Header) format email addresses
https://github.com/haraka/node-address-rfc2822
email headers parser rfc2822
Last synced: about 23 hours ago
JSON representation
Parser for RFC2822 (Header) format email addresses
- Host: GitHub
- URL: https://github.com/haraka/node-address-rfc2822
- Owner: haraka
- Created: 2013-03-14T14:46:50.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2025-01-13T20:31:25.000Z (26 days ago)
- Last Synced: 2025-01-28T11:42:36.805Z (11 days ago)
- Topics: email, headers, parser, rfc2822
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/address-rfc2822
- Size: 85 KB
- Stars: 53
- Watchers: 8
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
[![Build Status][ci-img]][ci-url]
[![Code Climate][clim-img]][clim-url]
[![Coverage Status][cov-img]][cov-url]# 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
```js
const addrparser = require('address-rfc2822')const addresses = addrparser.parse('Matt Sergeant ')
const address = addresses[0]console.log(`Email address: ${address.address}`) // [email protected]
console.log(`Email name: ${address.name()}`) // Matt Sergeant
console.log(`Reformatted: ${address.format()}`) // Matt Sergeant
console.log(`User part: ${address.user()}`) // helpme+npm
console.log(`Host part: ${address.host()}`) // gmail.com
```## More Info
- [RFC 2822](https://tools.ietf.org/html/rfc2822)
- [RFC 5322](https://tools.ietf.org/html/rfc5322)## License
This module is MIT licensed.
[ci-img]: https://github.com/haraka/node-address-rfc2822/actions/workflows/ci.yml/badge.svg
[ci-url]: https://github.com/haraka/node-address-rfc2822/actions/workflows/ci.yml
[cov-img]: https://codecov.io/github/haraka/node-address-rfc2822/coverage.svg
[cov-url]: https://codecov.io/github/haraka/node-address-rfc2822?branch=master
[clim-img]: https://codeclimate.com/github/haraka/haraka-plugin-template/badges/gpa.svg
[clim-url]: https://codeclimate.com/github/haraka/haraka-plugin-template