Greetings folks,
This isn't really a Linux question so forgive me for posting it but I m stumped and don't know where to turn. I have a web page and am trying to make a hit counter. I have it inside of <script></script> tags. The file count.txt is world writable. Any assistance would be most welcome.
Thanks in advance.
--glenn
Code:
// Requiring fs module in which
// writeFile function is defined.
const fs = require('fs');
var visitCount = fs.readFile('count.txt');
visitCount = Number(visitCount) + 1;
fs.writeFile('count.txt' visitCount err);
if (err) throw err;
mods, please move this to the programming forum