fastify-envalid
August 19, 2021 ยท View on GitHub
Supports Fastify versions 3.x
Install
npm i fastify-envalid
Usage
Require fastify-envalid and register.
import fastify from 'fastify'
import fastifyEnvalid from 'fastify-envalid'
const app = fastify()
fastify.register(fastifyEnvalid)
fastify.listen(3000)
The plugin will create 3 decorators on your fastify instance:
cleanEnv- A function which is exactlyenvalidcleanEnvvalidators- An object that contains all theenvalidvalidatorsmakeValidator- A function which is exactlyenvalidmakeValidators
Acknowledgements
The code is a port for Fastify of envalid.
License
Licensed under MIT.