html-text
v1.0.1
Published
Extract text from HTML.
Downloads
12
Maintainers
Readme
HTML Text
Extract text from HTML.
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.