A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Read the statement by Michael Teeuw here.
Getting date inside the config.js
-
Hello,
is there an option/way to get the current date (day, month) inside the config.js. I need this to config a module.
thanks
-
You could look at an npm module ‘fs’… that reads and writes to files. :) This one should work
https://www.npmjs.com/package/fs
Here’s some examples: https://code-maven.com/reading-a-file-with-nodejs
Here’s a snippet from one of my modules:
fileWrite: function() { fs.writeFile(this.path, JSON.stringify(this.recipe), function(err) { if (err) { return console.log(err); } console.log("The Recipe file was saved!"); }); },
-
@cowboysdude no. He wants to get the date/time value dynamically on his module config strings. You can certainly get it in the code, either module or helper