# vue-insane

> vue.js plugin for insane html sanitizer

Latest version **1.0.1** (published 2021-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-insane
pnpm add vue-insane
yarn add vue-insane
bun add vue-insane
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-09-09 |
| First published | 2021-09-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mameli Federico |
| Maintainers | federico.mameli |
| Keywords | vue, html, sanitizer, insane, html-sanitizer |

## Links

- npm: https://www.npmjs.com/package/vue-insane
- Repository: https://github.com/fech-dev/vue-insane
- npm.io page: https://npm.io/package/vue-insane

## Dependencies (2)

- [insane](https://npm.io/package/insane.md) ^2.6.2
- [lodash.merge](https://npm.io/package/lodash.merge.md) ^4.6.2

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2021-09-09
- 1.0.0 — 2021-09-09

## README

# vue-insane
Vue plugin for [insane](https://github.com/bevacqua/insane) sanitizer

## Usage
```
  npm install vue-insane
```

```
  yarn add vue-insane
```

Install as plugin, will install the instance method `$sanitizeHTML()` and the `v-sanitize-html` directive.
```js
import Vue from 'vue'
import VueInsanePlugin from 'vue-insane'

Vue.use(VueInsanePlugin, {
  .../*insane options*/
})


//only directive 
import { insaneDirective } from 'vue-insane'
Vue.directive('sanitize-html', insaneDirective)
```

## Usage on components
```vue
<template>
  <div>
    <!-- As method -->
    <p v-html="$sanitizeHTML(content)" />

    <!-- As Directive -->
    <p v-sanitize-html="content" />

    <!-- Set the 'strict' option to true -->
    <p v-sanitize-html.strict="content" />
  </div>
</template>
<script>
export default {
  data(){
    return {
      content: `<div><p>Hello World!</p></div>`
    }
  }
}
</script>
```

## `$sanitizeHTML(html, options, strict)`
| param | type | description |
|------|-------|-------------|
| html | `string` | The HTML string to sanitize |
| options | `object` |  The insane's options object. It will be merged with the options defined in the plugin registration. |
| strict | `boolean` | The strict param of insane function.|

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