1.0.2 • Published 6 years ago

fastify-require-feature v1.0.2

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

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