@npmcorp/joi-env

a joi extension providing support for environment variables

Usage no npm install needed!

<script type="module">
  import npmcorpJoiEnv from 'https://cdn.skypack.dev/@npmcorp/joi-env';
</script>

README

joi-env

This joi extension provides the ability to compose an object based off of environment variables, complete with validation and type coercion

Usage

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')
})