npm install process env code example
Example 1: node dotenv
require('dotenv').config();
console.log(process.env.MY_ENV_VAR);
Example 2: .env
require('dotenv').config()
const dotenv=require('dotenv');
//Usuage
process.env.NAME
require('dotenv').config();
console.log(process.env.MY_ENV_VAR);
require('dotenv').config()
const dotenv=require('dotenv');
//Usuage
process.env.NAME