html-email-to-text
Convert html emails to (formatted) plain text
Install
$ npm install --save html-email-to-text
Usage
const htmlToText = ; ;//=> Formatted plain text as a string
Examples
HTML input
Subject line: Title will be uppercase Hello there email coder this is an example of html-email-to-text formatting This email can be formatted in plain text too. <!-- whitespace and comments will be ignored --> It works with a link or two. If you wrap links around images it will use the alt text together with the link.
Text output
SUBJECT LINE: TITLE WILL BE UPPERCASE
--------------------
Hello there email coder this is an example of html-email-to-text formatting
This email can be formatted in plain text too.
It works with a link [/links] or two [/another-link].
If you wrap links around images it will use the alt text together with the link.
alt text
[/link-to-somewhere]
License
MIT © Andreas Nilsson