@mcrowe/html-purifier

Extract useful bits from huge html documents as fast as possible.

Stats

StarsIssuesVersionUpdatedCreatedSize
@mcrowe/html-purifier
000.0.44 years ago4 years agoMinified + gzip package size for @mcrowe/html-purifier in KB

Readme

html-purifier

Extract useful bits from huge html documents as fast as possible.

Usage

npm install @mcrowe/html-purifier --save

import HtmlPurifier from '@mcrowe/html-purifier'

const html = '<body><div></div><div id="rank">def<span>abc</span><script></script>123</div><div><section>toy<img class="my-image" src="hello" /> 123 </section></div></body>'

const result = HtmlPurifier.purify(html, [
  '#rank',
  '.my-image'
])

assert(
  result === '<div id="rank">def<span>abc</span>123</div><img class="my-image" src="hello" />'
)

Development

Install npm modules:

npm install

Run tests:

npm test

Release

Release a new version:

bin/release.sh

This will publish a new version to npm, as well as push a new tag up to github.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.