fastify-require-feature

1.0.2 • Public • Published

Feature requirement

This fastify plugin checks if a user meets the required browser features or redirects him to browser-update.org. You can also determine what should happen if the user doesn't meet the requirements.

Usage

const fastify = require("fastify")();
 
fastify.register(require("fastify-require-feature"), {
    features: ["flexbox"], // features which need to be supported 100% 
    partially: ["fetch"], // feature which can be supported partially
    action: "http://link.org", // or
    action: (request, reply, done) => {
        // Like a fastify hook
        done();
    }
});
 
// Your stuff
 
fastify.listen(8888, () => console.log("Ready"));

Used modules

Readme

Keywords

none

Package Sidebar

Install

npm i fastify-require-feature

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

19.4 kB

Total Files

5

Last publish

Collaborators

  • dunklestoast
  • thenoim