get-env-value
v4.0.0
Published
Easily get parsed values from your environment.
Downloads
129
Readme
get-env-value
Easily get parsed values from your environment.
Good to be used together with dotenv
Install
npm
npm install get-env-value --save
yarn
yarn add get-env-value
Usage
import getEnvValue from 'get-env-value';
const Config = {
DATABASE: {
HOST: getEnvValue.stringValue('DATABASE_HOST'),
NAME: getEnvValue.stringValue('DATABASE_NAME', 'db_name'),
PORT: getEnvValue.integerValue('DATABASE_PORT', 5432),
USER: getEnvValue.stringValue('DATABASE_USER', 'user'),
PASSWORD: getEnvValue.stringValue('DATABASE_PASSWORD'),
},
PORT: getEnvValue.integerValue('PORT', 3000),
};