# html-to-text
[![Build Status](https://travis-ci.org/werk85/node-html-to-text.svg?branch=master)](https://travis-ci.org/werk85/node-html-to-text)
[![Test Coverage](https://codeclimate.com/github/werk85/node-html-to-text/badges/coverage.svg)](https://codeclimate.com/github/werk85/node-html-to-text/coverage)
An advanced converter that parses HTML and returns beautiful text. It was mainly designed to transform HTML E-Mail templates to a text representation. So it is currently optimized for table layouts.
### Features:
* Transform headlines to uppercase text.
* Convert tables to an appropiate text representation with rows and columns.
* Word wrapping for paragraphs (default 80 chars).
* Automatic extraction of href information from links.
* `
` conversion to `\n`.
* Unicode support.
* Runs in browser and server environments.
## Installation
```
npm install html-to-text
```
Or when you want to use it as command line interface it is recommended to install it globally via
```
npm install html-to-text -g
```
## Usage
```js
const htmlToText = require('html-to-text');
const text = htmlToText.fromString('
ParagraphsAt vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Github At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. |
||||||||||||||||||||||||||
Pretty printed table
|
||||||||||||||||||||||||||
Lists
|
||||||||||||||||||||||||||
Column Layout with tables
|
||||||||||||||||||||||||||
Mailto formating
Some Company |