https://github.com/parro-it/imap-parsed-stream
https://github.com/parro-it/imap-parsed-stream
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/parro-it/imap-parsed-stream
- Owner: parro-it
- License: mit
- Created: 2015-08-09T20:01:28.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-11T17:16:54.000Z (almost 11 years ago)
- Last Synced: 2025-06-05T07:48:01.431Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 121 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# imap-parsed-stream
A simple objectMode through stream that parse rfc822
formatted emails to objects, using [mailparser](https://github.com/andris9/mailparser)
## Installation
```bash
npm install --save imap-parsed-stream
```
## How it works
## Usage
```javascript
import imapParsedStream from 'imap-parsed-stream'
const parse = imapParsedStream();
mailsStream
.pipe(imapParsedStream)
.pipe(concat({encoding: 'object'}, result => {
// result is an array of parsed mail
}));
```
## Example object output
```json
[
{
"headers": {
"date": "Sat, 28 Dec 2013 07:12:01 -0800 (PST)",
"subject": "Aggiungi una foto del profilo",
"from": "\"Google+\" ",
"to": "imaptest73@gmail.com"
},
"subject": "Aggiungi una foto del profilo",
"priority": "normal",
"from": [
{
"address": "noreply-bbf11161@plus.google.com",
"name": "Google+"
}
],
"to": [
{
"address": "imaptest73@gmail.com",
"name": ""
}
],
"date": "2013-12-28T15:12:01.000Z"
},{
"headers": {
"date": "Tue, 03 Dec 2013 14:05:25 -0800 (PST)",
"subject": "I post più popolari della settimana su Google+",
"from": "\"Google+\" ",
"to": "imaptest73@gmail.com"
},
"subject": "I post più popolari della settimana su Google+",
"priority": "normal",
"from": [
{
"address": "noreply-bbf11161@plus.google.com",
"name": "Google+"
}
],
"to": [
{
"address": "imaptest73@gmail.com",
"name": ""
}
],
"date": "2013-12-03T22:05:25.000Z"
}
]
```
## License
The MIT License (MIT)
Copyright (c) 2015 Andrea Parodi