Socket
Socket
Sign inDemoInstall

addressparser

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

addressparser - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

.jshintrc

37

package.json
{
"name": "addressparser",
"version": "0.2.1",
"description": "Parse e-mail addresses",
"main": "index.js",
"scripts": {
"test": "nodeunit test.js"
},
"repository": {
"type": "git",
"url": "https://github.com/andris9/addressparser.git"
},
"author": "Andris Reinman",
"license": "MIT",
"devDependencies":{
"nodeunit": "*"
}
}
"name": "addressparser",
"version": "0.3.0",
"description": "Parse e-mail addresses",
"main": "src/addressparser.js",
"repository": {
"type": "git",
"url": "https://github.com/andris9/addressparser.git"
},
"author": "Andris Reinman",
"license": "MIT",
"scripts": {
"test": "grunt"
},
"devDependencies": {
"chai": "~1.8.1",
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.8.0",
"grunt-mocha-test": "~0.10.0"
}
}

@@ -9,3 +9,5 @@ # addressparser

npm install addressparser
```
npm install addressparser
```

@@ -16,35 +18,44 @@ ## Usage

var addressparser = require("addressparser");
```javascript
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"}]
```javascript
var addresses = addressparser('andris <andris@tr.ee>');
console.log(addresses); // [{name: "andris", address:"andris@tr.ee"}]
```
And when using groups
addressparser('Composers:"Bach, Sebastian" <sebu@example.com>, mozart@example.com (Mozzie);');
```javascript
addressparser('Composers:"Bach, Sebastian" <sebu@example.com>, mozart@example.com (Mozzie);');
```
the result is
the result would be
[
{
name: "Composers",
group: [
{
address: "sebu@example.com",
name: "Bach, Sebastian"
},
{
address: "mozart@example.com",
name: "Mozzie"
}
]
}
]
```json
[
{
name: "Composers",
group: [
{
address: "sebu@example.com",
name: "Bach, Sebastian"
},
{
address: "mozart@example.com",
name: "Mozzie"
}
]
}
]
```
> Be prepared though that groups might be nested.
## 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
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

@@ -51,0 +62,0 @@ ## License

Sorry, the diff of this file is not supported yet

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