fastify-hide-powered-by
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

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

/fastify-hide-powered-by/

    Package Sidebar

    Install

    npm i fastify-hide-powered-by

    Weekly Downloads

    0

    Version

    0.4.0

    License

    MIT

    Unpacked Size

    5.91 kB

    Total Files

    5

    Last publish

    Collaborators

    • poppinl