email-body-cleaner
v0.0.4
Published
Get clean ( latest ) message from email body tree
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
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 <[email protected]>
*Sent:* Tuesday, November 12, 2019 6:07 PM
*To:* [email protected] <[email protected]>
*Subject:* Fwd: Urgent thing
---------- Forwarded message ---------
From: *anothername anotherlastname* <[email protected]>
Date: Tue, Nov 12, 2019 at 1:10 PM
Subject: Re: Another urgent thing
To: <[email protected]>
Burning deadline
On Tue, Nov 12, 2019 at 11:51 anothername anotherlastname <[email protected]> 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.
