0.4.0 • Published 2 years ago

fastify-hide-powered-by v0.4.0

Weekly downloads
17
License
MIT
Repository
github
Last release
2 years ago

fastify-hide-powered-by

Build Status Code coverage Code style Dependency Status Dev Dependency Status NPM version NPM downloads NPM license

Fastify plugin to remove the X-Powered-By header

Why?

You may know hide-powered-by as a hide-powered-by middleware used in helmet. And you could use it as a middleware in fastify also. So why i made this plugin?

You may find the reason in benchmark result and wish you like it. :)

Difference

This plugin has passed all hide-powered-by test cases. And no difference in options.

Install

Via npm:

npm i fastify-hide-powered-by

Via yarn:

yarn add fastify-hide-powered-by

Usage

const fastify = require('fastify');
const fastifyHidePoweredBy = require('fastify-hide-powered-by');

const app = fastify();
app.register(fastifyHidePoweredBy);

app.listen(3000, err => {
  if (err) throw err;
});

Options

This plugin has the same options as the middleware in helmet.

setTo {string|undefined}

Default is undefined which means remove X-Powered-By header. You could pass a string in to set X-Powered-By to that.

Changelog

  • 0.3.0
    • Update test case
  • 0.2.0
    • Add test case
    • Add code coverage
    • Add benchmarks
  • 0.1.0:
    • Init version