This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
// Function to read the .env file and parse it into a key-value object | |
function readEnvFile(filePath) { | |
const envData = {}; | |
const fileContent = fs.readFileSync(filePath, "utf-8"); | |
fileContent.split("\n").forEach((line) => { | |
const trimmedLine = line.trim(); |