0.6.2 • Published 10 years ago

dotenvdotenv v0.6.2

Weekly downloads
1
License
ISC
Repository
github
Last release
10 years ago

dotenvdotenv

Zero-dependency lib that loads environment variables from .env.${ENV_NAME} files

BuildStatus NPM version Code Climate

Install

npm install dotenvdotenv --save

Usage

Require the lib as early as possible in your app

require('dotenvdotenv');

Create the .env.dev and .env.test files in the root directory and add environment variables on new lines as KEY=VALUE

For example:

REDIS_HOST=localhost
REDIS_PORT=32776

The vars are now available on process.env

redis: {
  host: process.env.REDIS_HOST,
  port: process.env.REDIS_PORT
}

If the .env.${ENV_NAME} files do no exist, an error will be raised

Supports

Node:

  • v0.10
  • v0.12
  • v4
  • v5
  • v6

FAQ

Should I commit my .env.${ENV_NAME} files?

No. .env.${ENV_NAME} files should not be committed to version control. Your production environment should use the environment variables

What happens to existing environment variables?

Existing environment variables will not be overwritten

0.6.2

10 years ago

0.6.1

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.1

10 years ago