fastify-strip-html
v0.0.2
Published
A plugin to automatically strip HTML tags from response payload
Downloads
17
Maintainers
Readme
fastify-strip-html
A plugin to automatically strip HTML tags from response payload
Install
$ npm i --save fastify-strip-html
Usage
fastify.register(require('fastify-strip-html'), {
stripFromResponse: true
})
// To test it manually:
console.log(fastify.stripHtml('<a>Hello World</a>'))
// <a>Hello World</a> -> Hello World
Options
| Name | Description |
|-----------------------|------------------------------------------------------------------------|
| stripFromResponse
| Register a onSend
hook to strip HTML tags out from a string payload. |
Test
$ npm test
Acknowledgements
This project is kindly sponsored by:
License
Licensed under MIT