August 2018
Beginner to intermediate
214 pages
6h 39m
English
The dotenv module makes configuration of environment variables that you don't want to, say, commit to GitHub, easy. You load it into your Node.js application:
const dotenv = require('dotenv').config()
This loads a .env file in the same directory that the Node.js file is in, which is in the following format:
KEY=value
And it is then accessible in your application via the process.env global variable:
let key = process.env.KEY // 'value'
Now that we know more about the libraries and services we're using, let's get a test connection program set up!
Read now
Unlock full access