Skip to content

Instantly share code, notes, and snippets.

@maxbeatty
Created June 26, 2015 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxbeatty/d800de03a3e34986c043 to your computer and use it in GitHub Desktop.
Save maxbeatty/d800de03a3e34986c043 to your computer and use it in GitHub Desktop.
Verifying motdotla/dotenv#76
assert = require('assert');
require('dotenv').config({path: 'production.env'});
assert.equal(process.env.DB_USER, 'root')
assert.equal(process.env.PORT, 80)
DB_USER=root
PORT=80
@maxbeatty
Copy link
Author

To clone and run this snippet:

$ git clone https://gist.github.com/d800de03a3e34986c043.git
$ cd d800de03a3e34986c043
$ npm i dotenv
$ node app.js

(no output means all assertions passed. an error will be thrown if an assertion fails)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment