# mrclean

> A Simple HTML Sanitizer

Latest version **0.1.0** (published 2012-01-26) · 0 weekly downloads

## Install

```sh
npm install mrclean
pnpm add mrclean
yarn add mrclean
bun add mrclean
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2012-01-26 |
| First published | 2012-01-26 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ~0.6.x |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Tom Wilson |
| Maintainers | jackhq |

## Links

- npm: https://www.npmjs.com/package/mrclean
- Repository: https://github.com/beautifulnode/mrclean
- npm.io page: https://npm.io/package/mrclean

## Recent versions

- 0.1.0 (latest) — 2012-01-26

## README

Mr Clean 0.0.1
========

![MrClean](http://upload.wikimedia.org/wikipedia/en/thumb/7/73/Mr._Clean_logo.png/220px-Mr._Clean_logo.png)

[![Build Status](https://secure.travis-ci.org/beautifulnode/mrclean.png)](http://travis-ci.org/beautifulnode/mrclean)

It's a HTML Sanitizer!
It's a genie!

It's fabulous!

## Install

``` sh
npm install mrclean
```

## Usage in NodeJs

with default blacklist

``` javascript
mrclean = require('mrclean');

dirtyHtml = "Hi! <script src='http://www.evilsite.com/bad_script.js'></script>It's a good day!"
mrclean().clean(dirtyHtml, function(err, cleanHtml) {
  // All Clean!
  console.log(cleanHtml);
});

```

with your own blacklist

``` javascript
mrclean = require('mrclean');

dirtyHtml = "Hi! <script src='http://www.evilsite.com/bad_script.js'></script>It's a good day!"
mrclean("html body link script").clean(dirtyHtml, function(err, cleanHtml) {
  // All Clean!
  console.log(cleanHtml);
});

```


## Usage in the Browser

First add mrclean.js to your html page.

``` javascript
<script type="text/javascript">
$(document).ready(function() {
  $('button').click(function() {
    MrClean().clean($('textarea').val(), function(err, cleanText) {
      console.log(cleanText);
    });
  });
});

</script>

```

## Build Script to browserify node module

```
npm install browserify -g
browserify browser.js -o mrclean.js
```

## Run Tests

```
npm test
```
## Contributing

Contributors are welcome, please create issues and submit pull requests in feature branches!

See [http://scottchacon.com/2011/08/31/github-flow.html](http://scottchacon.com/2011/08/31/github-flow.html)

## License

SEE LICENSE

---
_Source: https://npm.io/package/mrclean · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
