0.0.2 • Published 4 years ago

fastify-strip-html v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

fastify-strip-html

A plugin to automatically strip HTML tags from response payload

Node.js CI

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

NameDescription
stripFromResponseRegister a onSend hook to strip HTML tags out from a string payload.

Test

$ npm test

Acknowledgements

This project is kindly sponsored by:

heply

License

Licensed under MIT