denv

1.0.4 • Public • Published

denv

NPM version NPM Downloads

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

LICENSE

MIT License

/denv/

    Package Sidebar

    Install

    npm i denv

    Weekly Downloads

    5

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    6.12 kB

    Total Files

    5

    Last publish

    Collaborators

    • kafka