This joi extension provides the ability to compose an object based off of environment variables, complete with validation and type coercion
const BaseJoi = require('@hapi/joi')
const JoiEnv = require('joi-env')
const Joi = BaseJoi.extend(JoiEnv)
const schema = Joi.object({
myKey: Joi.string().env('MY_KEY')
})