You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@mcrowe/html-purifier

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mcrowe/html-purifier

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

0.0.4
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

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.

FAQs

Package last updated on 24 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts