Just create your .env file and load all your environment variables.
npm install simpledot --save
just require and use .
var env = require('simpledot')
First create your .env
file in the root directory of your project.
Then add variables on new lines in the form of NAME=VALUE
.
For example:
DB_HOST=localhost
DB_USER=cucine
DB_PASS=imeasy
Now just use it.
env.YOUR_VARIABLE
and that's the way.
var env = require('simpledot')
db.connect({
host: env.DB_HOST,
username: env.DB_USER,
password: env.DB_PASS
})