Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/beliven-it/fastify-strip-html
A plugin to automatically strip HTML tags from response payload
https://github.com/beliven-it/fastify-strip-html
fastify html js nodejs security strip tags
Last synced: 26 days ago
JSON representation
A plugin to automatically strip HTML tags from response payload
- Host: GitHub
- URL: https://github.com/beliven-it/fastify-strip-html
- Owner: beliven-it
- License: mit
- Created: 2020-06-12T08:16:16.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T02:44:03.000Z (almost 2 years ago)
- Last Synced: 2024-08-09T16:36:02.203Z (5 months ago)
- Topics: fastify, html, js, nodejs, security, strip, tags
- Language: JavaScript
- Size: 855 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fastify-strip-html
A plugin to automatically strip HTML tags from response payload
![Node.js CI](https://github.com/heply/fastify-strip-html/workflows/Node.js%20CI/badge.svg)
## Install
```bash
$ npm i --save fastify-strip-html
```## Usage
```js
fastify.register(require('fastify-strip-html'), {
stripFromResponse: true
})// To test it manually:
console.log(fastify.stripHtml('Hello World'))
// Hello World -> Hello World
```## Options
| Name | Description |
|-----------------------|------------------------------------------------------------------------|
| `stripFromResponse` | Register a `onSend` hook to strip HTML tags out from a string payload. |## Test
```bash
$ npm test
```## Acknowledgements
This project is kindly sponsored by:
[![Beliven](https://assets.beliven.com/brand/logo_pos_color.svg)](https://www.beliven.com)
## License
Licensed under [MIT](./LICENSE)