fastify-strip-html

A plugin to automatically strip HTML tags from response payload

Usage no npm install needed!

<script type="module">
  import fastifyStripHtml from 'https://cdn.skypack.dev/fastify-strip-html';
</script>

README

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

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:

heply

License

Licensed under MIT