fastify-strip-html

0.0.2 • Public • Published

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

Dependents (0)

Package Sidebar

Install

npm i fastify-strip-html

Weekly Downloads

8

Version

0.0.2

License

MIT

Unpacked Size

5.29 kB

Total Files

6

Last publish

Collaborators

  • beliven.dev