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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login