Menu
Hello i am using Node Js file system to make my code write the current date and time onto the “text.txt” file in my directory every 3sec in my directory……….
it only prints out one date…. any help? here is my code
var fs = require(‘fs’);
var http = require(‘http’);
function displayDate(){
Date();
};
var showDate = setInterval(displayDate,3000);
fs.writeFile(‘text.txt’,Date(), () => {
console.log(“The App is running…..”);
});