node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

dotenv-node

DotEnv for Node.js

Build Status

DotEnv loads environment variables from .env into your ENV.

Installation

As early as possible in your application require dotenv and load the .env variables.

DotEnv = require('dotenv-node');
new DotEnv();

Usage

Add your application configuration to a .env file in the root of your project:

S3_BUCKET=YOURS3BUCKET
SECRET_KEY=YOURSECRETKEYGOESHERE

When your application loads, these variables will be available via process.env:

process.env.S3_BUCKET;
process.env.SECRET_KEY;

Inspiration

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Running tests

npm install
npm test