denv
v1.0.4
Published
Easy load environment variables in your app inside docker container
Downloads
72
Readme
denv
Easy load environment variables in your app inside docker container
Installation
$ npm install --save denv
USAGE
const denv = require('denv');
const { env, addr, port } = denv();
// Redis example
const conString = `redis://${env('redis_user', '')}\
:${env('redis_password', '')}\
@${addr('127.0.0.1')}\
:${port('6379')}\
/${env('db', 0)}`;
// Postgres example
const conString = `postgres://${env('postgres_user', 'postgres')}\
:${env('postgres_password', 'mysecretpassword')}\
@${addr('127.0.0.1')}\
:${port('5432')}\
/${env('database', 'postgres')}`;
Tests
$ npm test