0.1.3 • Published 2 years ago
@caviajs/env v0.1.3
Introduction
Environment variables are injected from outside-in to your application, and you have little or no control over them within your codebase, so you should validate your environment variables.
Usage
Installation
npm install @caviajs/env --save
Validating environment variables
import { Env } from '@caviajs/env';
Env.validate({
NODE_ENV: {
expressions: [
/^(dev|prod|test)$/,
],
maxLength: 4,
minLength: 1,
required: true,
},
/* ... */
});