html-text
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i html-text

Weekly Downloads

9

Version

1.0.1

License

MIT

Unpacked Size

3.31 kB

Total Files

6

Last publish

Collaborators

  • richienb