getting error : TypeError: fs.readFileSync is not a function when i tried to use get value from .env file, can anyone please help me why i am getting this error? here i have uploaded my code, can anyone please help me how to resolve this issue ? any help will be really appreciated.
const dotenv = require('dotenv').config();
const fs = require('fs');
const envConfig = dotenv.parse(fs.readFileSync('.env'))
for (const k in envConfig) {
process.env[k] = envConfig[k]
}