dotenv-node

Loads environment variables from .env

npm install dotenv-node
2 downloads in the last day
17 downloads in the last week
316 downloads in the last month

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
npm loves you