Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/madmax3365/email-body-cleaner

Get clean ( latest ) message from email body tree
https://github.com/madmax3365/email-body-cleaner

email-body-parsing typescript

Last synced: about 7 hours ago
JSON representation

Get clean ( latest ) message from email body tree

Awesome Lists containing this project

README

        

# email-body-cleaner

Module designed to extract latest message from email body.

Currently guaranteed working if sender's mail client is `GMail` or `Outlook`

**Note** Module still in development, and not tested properly, so use it at your own risk 🙃

## Installation
Just type

`npm i email-body-cleaner`

## Usage example
```javascript
import { parseRaw } from 'email-body-cleaner'; // commonJs style
const parser = require('email-body-cleaner'); // standard require style

const exampleBody = `Understood! Thanks mate !

------------------------------
*From:* somename lastname
*Sent:* Tuesday, November 12, 2019 6:07 PM
*To:* [email protected]
*Subject:* Fwd: Urgent thing

---------- Forwarded message ---------
From: *anothername anotherlastname*
Date: Tue, Nov 12, 2019 at 1:10 PM
Subject: Re: Another urgent thing
To:

Burning deadline

On Tue, Nov 12, 2019 at 11:51 anothername anotherlastname wrote:`;

const result = parseRaw(exampleBody); // parser.parseRaw(exampleBody);

console.log(result); // Will print: Understood! Thanks mate !

```

## Contributing

If you're interested in helping me to improve / add functionality, I'm kindly welcome you 🤗

Please feel free to send PR - s with your awesome code.