Skip to content

Latest commit

 

History

History

node

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

JavaScript/Node Dotenv

For using it in node first you have to have:

  1. A Node version installed.

  2. Installed the node-dotenv package. You can do it just by running npm install dotenv --save.

For a .env file like this:

require('dotenv').config(".env");

const DB_NAME = process.env.DB_NAME
console.log(DB_NAME);