# html2plaintext

> Convert HTML-formatted text to plaintext

Latest version **2.1.4** (published 2021-11-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install html2plaintext
pnpm add html2plaintext
yarn add html2plaintext
bun add html2plaintext
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.4 |
| Published | 2021-11-17 |
| First published | 2013-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 68 |
| Author | Kurt Ericson |
| Maintainers | kurttheviking |
| Keywords | html, plain, text |

## Links

- npm: https://www.npmjs.com/package/html2plaintext
- Repository: https://github.com/kurttheviking/html2plaintext
- Homepage: https://github.com/kurttheviking/html2plaintext#readme
- Issues: https://github.com/kurttheviking/html2plaintext/issues
- npm.io page: https://npm.io/package/html2plaintext

## Dependencies (3)

- [he](https://npm.io/package/he.md) 1.2.0
- [plumb](https://npm.io/package/plumb.md) 0.1.0
- [cheerio](https://npm.io/package/cheerio.md) 1.0.0-rc.10

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 2.1.4 (latest) — 2021-11-17
- 2.1.3 — 2021-11-17
- 2.1.2 — 2018-12-30
- 2.1.1 — 2018-12-30
- 2.1.0 — 2018-10-04
- 2.0.1 — 2017-12-29
- 2.0.0 — 2017-12-29
- 1.1.1 — 2017-01-13
- 1.1.0 — 2017-01-13
- 1.0.1 — 2014-07-06
- 1.0.0-rc2 — 2014-01-30
- 0.2.2 — 2013-06-25
- 0.2.1 — 2013-06-13
- 0.2.0 — 2013-05-02
- 0.1.0 — 2013-04-29

## README

html2plaintext
==============

Convert html-formatted text to plaintext

- strip tags
- reformat ordered/unordered lists
- treat whitespace like a browser
- decode html entities


### Use

```js
var h2p = require('html2plaintext')

h2p('<p>Hello,\n   &amp; <em>how  are <a href="https://me.com">you</a>?</em></p>')
// => "Hello, & how are you?"
```

### Install

```sh
npm install html2plaintext
```

### Test

```sh
npm install
npm test
```

---
_Source: https://npm.io/package/html2plaintext · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
