Node library for parsing plain text email content. Based on https://github.com/willdurand/EmailReplyParser
npm install email-reply-parser   
Email Reply Parser is a node library to parse plain-text email replies and extract content
This library supports most email replies, signatures and locales.
😘 Maintainer: @baptistejamin
| Crisp |
_👋 You use this library and you want to be listed there? Contact us._
Install the project using NPM:
`` javascript`
npm install --save email-reply-parser
This library uses the RE2 regex engine when available for better performance and ReDoS protection. It automatically falls back to native JavaScript RegExp if RE2 is unavailable or fails to load.
RE2 is an optional dependency installed by default. If you encounter native compilation issues or want to exclude it:
`bash`
npm uninstall re2
After a Node.js upgrade, you may need to rebuild RE2:
`bash`
npm rebuild re2
This library is used at Crisp everyday with around 1 million inbound emails. Over the years, we improved this library so it can work with most emails.
- Strip email replies like On DATE, NAME Sent from my iPhone
- Supports around 10 locales, including English, French, Spanish, Portuguese, Italian, Japanese, Chinese.
- Removes signatures like Best wishes
- Removes signatures like
` javascript
import EmailReplyParser from "email-reply-parser";
const email = new EmailReplyParser().read(MY_EMAIL_STRING);
console.log(email.getVisibleText());
`
` javascript
import EmailReplyParser from "email-reply-parser";
const emailContent = Hi there,
I appreciate your help with this issue.
Best regards,
John
On Dec 16, 2024, at 12:47 PM, Support
> How can we help you today?
>
> Thanks,
> Support Team;
const parser = new EmailReplyParser();
console.log(parser.parseReply(emailContent));
// Output: "Hi there,\n\nI appreciate your help with this issue."
`
Feel free to fork this project and submit fixes. We may adapt your code to fit the codebase.
You can run unit tests using:
` javascript``
npm test
* GitHub
* William Durand
* Crisp IM
email-reply-parser is released under the MIT License. See the bundled LICENSE file for details.