1.0.1 • Published 4 years ago

html-text v1.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

HTML Text Travis CI Build Status

Extract text from HTML.

NPM Badge

Install

npm install html-text

Strategy

The input HTML is prettified to clean it up and unindent the code, stripped from tags and trimmed to removed newlines and spaces.

Usage

const htmlText = require("html-text");

htmlText(`
<!DOCTYPE html>
<html id="home" lang="en">

<body>
  <main>
    <p>Site Content.</p>
  </main>
</body>

</html>
`);
//=> 'Site Content.'

API

htmlText(input)

input

Type: string

The HTML to strip the tags from.