ye code shirf is liye comment kiya ki ye meaningful example hai to samajna easy rahega const fs = require("fs"); const fileName = "fsPromises.txt"; const updateData = "Update File Data"; fs.promises .writeFile(fileName, updateData, "utf-8") .then(() => console.log("File written successfully:", updateData)) .catch((error) => { const errorMessage = `${new Date().toISOString()} - Error: ${ error.message } `; fs.promises .appendFile("error.txt", errorMessage, "utf-8") .then(() => console.log("Error logged to file")) .catch((err) => console.log("Failed to write error log:", err)); console.log(error); }); basically is code me ho ye raha hi ki jo error aayegi wo error.txt file me append hoti jayegi helpful laga ho to like kar dijiye
Bro, even if you make mistakes, we learn much more from it, keep it up
blessed to have teacher(bhaiya) like him 🖤🤍
DAY - 14 COMPLETED ❤ THANK YOU VINOD BHAIYA 🎉
Consistent rahena he 🔥
Okay.. Present sir...!
Day 14 complete ✅
Day 14 done
Completed💪
Awasome video 🔥🔥🔥
Day 14 completed still the same energy
Day 14 was completed
Day 14 - Present Sir
Present sir...!
Present 🤚
❤
sir please din me 2 video upload kro
Day 14 complete Date 01/12/2024
gogogo
#Day-14Consistent rahunga iss bar
Day14 attendence done
ye code shirf is liye comment kiya ki ye meaningful example hai to samajna easy rahega
const fs = require("fs");
const fileName = "fsPromises.txt";
const updateData = "Update File Data";
fs.promises
.writeFile(fileName, updateData, "utf-8")
.then(() => console.log("File written successfully:", updateData))
.catch((error) => {
const errorMessage = `${new Date().toISOString()} - Error: ${ error.message }
`;
fs.promises
.appendFile("error.txt", errorMessage, "utf-8")
.then(() => console.log("Error logged to file"))
.catch((err) => console.log("Failed to write error log:", err));
console.log(error);
});
basically is code me ho ye raha hi ki jo error aayegi wo error.txt file me append hoti jayegi
helpful laga ho to like kar dijiye
Day 14 complete ✅