Marsup / joi-env

A joi extension to allow reading values from environment variables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A joi extension to allow reading values from environment variables


Languages

Language:JavaScript 100.0%