Environment configuration loader for Lad
npm:
npm install @ladjs/env
const env = require('@ladjs/env')();
console.log(env);
You can pass any option as you otherwise would normally to dotenv-extended.
Here is the default option argument, note that it supports a .env.test
path for TEST
and TESTING
environments as specified through process.env.NODE_ENV
.
const env = require('@ladjs/env')({
encoding: 'utf8',
silent: true,
path: '.env',
defaults: '.env.defaults',
schema: '.env.schema',
errorOnMissing: true,
errorOnExtra: true,
errorOnRegex: false,
includeProcessEnv: true,
assignToProcessEnv: true,
overrideProcessEnv: false,
});
Name | Website |
---|---|
Nick Baugh | http://niftylettuce.com/ |