Skip to content

Instantly share code, notes, and snippets.

View shreekrishnalamichhane's full-sized avatar
🏠
Work from home

Shree Krishna Lamichhane shreekrishnalamichhane

🏠
Work from home
View GitHub Profile
@shreekrishnalamichhane
shreekrishnalamichhane / gist:6a21ef1c307aa9ee4b8f6fbbe086e067
Created October 22, 2024 15:39
Generate env diff between two files
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();