I am using dotenv package in my node/express project.
I have an root/index file where I am importing different files.
I imported dotenv in index file only. There within index file environment variable are accessible but in the imported file these are not accessible. How can I make it accessible inside other file imported inside indes.js?
Here's a glimpse of my code
index.js
import dotenv from "dotenv";
dotenv.config();
import { sync, getImages, downloadImage } from "./api/controllers/shutterstock";
console.log(process.env.SHUTTERSTOCK_ACCESS_TOKEN); //===>Working gives me the access token
api/controllers/shutterstock.js
console.log(process.env.SHUTTERSTOCK_ACCESS_TOKEN); //===>undefined
