extract-text-html vs striptags
const striptags = require('striptags@3.2.0')
const { extractText } = require('extract-text-html@0.2.0')
const html = `
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://static-production.npmjs.com/styles.74f9073cf68d3c5f4990.css" />
Should not include
</head>
<noscript>
<!-- anchor linking to external file -->
<a href="https://www.mozilla.org/">External Link</a>
</noscript>
<style>
p {
color: #26b72b;
}
</style>
<meta http-equiv="refresh" content="3;url=https://www.mozilla.org" />
<TITLE data-react-helmet="true">extracttext - npm search</TITLE>
<!-- Some comment -->
<h1>Some Title</h1>
<div style="font-weight: bold">Some text</div>
<script crossorigin="anonymous" src="https://static-production.npmjs.com/minicssextractbug.536095f4b1a94d2b149c.js"></script>
<script crossorigin="anonymous" src="https://static-production.npmjs.com/search/search.9fbe393f02970084bce5.js"></script>
<script>
const FOO = 'bar'
</script>
`
console.log(striptags(html))
console.log(extractText(html))
no comments