1.0.8 • Published 9 years ago

env-get v1.0.8

Weekly downloads
8
License
ISC
Repository
github
Last release
9 years ago

env-get

Simple utility to get environment variables with an optional default.
Throws an error if the variable is not found and no default is supplied.

This utility was designed to support twelve-factor applications and the strict separation of code and config.

Read more about it here.

NPM Version NPM Monthly Test Status Coverage Status

Usage:

const env = require('env-get');

// PORT not set
const port = env.get('PORT', 4000);
console.log(port); // 4000

// TOKEN not set
const token = env.get('TOKEN'); // throws Error 

// HOSTNAME set
const hostname = env.get('HOSTNAME'); 
console.log(hostname); // blaing.io
1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.0

11 years ago