# gumbo-sanitize

> Gumbo Sanitize is a loose port of the [Ruby Sanitize library][sanitize] by Ryan Grove based on [Google's Gumbo parser][gumbo]. This module differs from [Sanitize.js][sanitize.js] in that it only supports nodejs and a subset of the Ruby Sanitize API.

Latest version **0.1.0** (published 2015-06-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install gumbo-sanitize
pnpm add gumbo-sanitize
yarn add gumbo-sanitize
bun add gumbo-sanitize
```

## 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 | 2015-06-06 |
| First published | 2015-06-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | mikepb |

## Links

- npm: https://www.npmjs.com/package/gumbo-sanitize
- Repository: https://github.com/mikepb/node-gumbo-sanitize
- Homepage: https://github.com/mikepb/node-gumbo-sanitize#readme
- Issues: https://github.com/mikepb/node-gumbo-sanitize/issues
- npm.io page: https://npm.io/package/gumbo-sanitize

## Dependencies (2)

- [he](https://npm.io/package/he.md) ^0.5.0
- [gumbo-parser](https://npm.io/package/gumbo-parser.md) ^0.2.1

## Recent versions

- 0.1.0 (latest) — 2015-06-06
- 0.0.2 — 2015-06-06
- 0.0.1 — 2015-06-04

## README

# gumbo-sanitize

Gumbo Sanitize is a loose port of the [Ruby Sanitize library][sanitize] by Ryan
Grove based on [Google's Gumbo parser][gumbo]. This module differs from
[Sanitize.js][sanitize.js] in that it only supports nodejs and a subset of the
Ruby Sanitize API.

## Install

```sh
npm install --save gumbo-sanitize
```

## Usage

```js
var sanitize = require("gumbo-sanitize");
console.log(sanitize("<img src=javascript:alert('XSS')>", sanitize.RELAXED));
// prints <img>
```

Alternatively, you may also use the `Sanitize` class directly:

```js
var Sanitize = require("gumbo-sanitize");
var s = new Sanitize(Sanitize.RELAXED);
console.log(s.sanitize("<img src=javascript:alert('XSS')>"));
```

## Documentation

For now, please see the source code for documentation. Open to contributions :)

## License

MIT

[gumbo]: https://github.com/google/gumbo-parser
[sanitize]: https://github.com/rgrove/sanitize
[sanitize.js]: https://github.com/gbirke/Sanitize.js

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