Start Coding with Codelab | Jaeves AI

Nodejs create env file – ReadyMadeCode

Written by Admin | Oct 2, 2023 8:23:53 PM

Nodejs create env file

install npm package dotenv

Create .env file in the root folder of project, create some variables.

MY_VAR1="value1"
MY_VAR2="value2"

Use variables

require('dotenv').config();

console.log(process.env.MY_VAR1);

click for more Nodejs codes