A plugin to automatically strip HTML tags from response payload
$ npm i --save fastify-strip-html
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
Name | Description |
---|---|
stripFromResponse |
Register a onSend hook to strip HTML tags out from a string payload. |
$ npm test
This project is kindly sponsored by:
Licensed under MIT